diff --git a/tests/acceptance/features/bootstrap/FeatureContext.php b/tests/acceptance/features/bootstrap/FeatureContext.php index 254c89a606..1c3a98d02e 100644 --- a/tests/acceptance/features/bootstrap/FeatureContext.php +++ b/tests/acceptance/features/bootstrap/FeatureContext.php @@ -52,6 +52,7 @@ class FeatureContext extends BehatVariablesContext { use Provisioning; use Sharing; use WebDav; + use JsonAssertions; /** * Unix timestamp seconds @@ -1360,7 +1361,7 @@ class FeatureContext extends BehatVariablesContext { PyStringNode $schemaString ): void { $jsonResponse = $this->getJsonDecodedResponseBodyContent(); - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->assertJsonDocumentMatchesSchema( $jsonResponse->ocs->data, $this->getJSONSchema($schemaString) ); @@ -1377,7 +1378,7 @@ class FeatureContext extends BehatVariablesContext { */ public function theDataOfTheResponseShouldMatch(PyStringNode $schemaString): void { $responseBody = $this->getJsonDecodedResponseBodyContent(); - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->assertJsonDocumentMatchesSchema( $responseBody, $this->getJSONSchema($schemaString) ); diff --git a/tests/acceptance/features/bootstrap/GraphContext.php b/tests/acceptance/features/bootstrap/GraphContext.php index fb58da2daf..b1a80d9038 100644 --- a/tests/acceptance/features/bootstrap/GraphContext.php +++ b/tests/acceptance/features/bootstrap/GraphContext.php @@ -13,7 +13,6 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; -use Helmich\JsonAssert\JsonAssertions; use Psr\Http\Message\ResponseInterface; use TestHelpers\GraphHelper; use TestHelpers\WebDavHelper; @@ -2035,7 +2034,7 @@ class GraphContext implements Context { !$shouldContain && $userOrGroupFound, 'Response contains user or group "' . $userOrGroup . '" but should not have.' ); - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->featureContext->assertJsonDocumentMatchesSchema( $responseBody, $this->featureContext->getJSONSchema($schemaString) ); @@ -2371,7 +2370,7 @@ class GraphContext implements Context { "Response does not contain event type '" . $eventType . "'." ); } - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->featureContext->assertJsonDocumentMatchesSchema( $actualResponseToAssert, $this->featureContext->getJSONSchema($schemaString) ); @@ -2393,7 +2392,7 @@ class GraphContext implements Context { "Response does not contain key 'user'" ); } - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->featureContext->assertJsonDocumentMatchesSchema( $actualResponseToAssert->user, $this->featureContext->getJSONSchema($schemaString) ); diff --git a/tests/acceptance/features/bootstrap/NotificationContext.php b/tests/acceptance/features/bootstrap/NotificationContext.php index 5e17e82e79..4fdaf1a767 100644 --- a/tests/acceptance/features/bootstrap/NotificationContext.php +++ b/tests/acceptance/features/bootstrap/NotificationContext.php @@ -10,7 +10,6 @@ use Behat\Behat\Context\Context; use Behat\Behat\Hook\Scope\BeforeScenarioScope; use TestHelpers\OcsApiHelper; use Behat\Gherkin\Node\PyStringNode; -use Helmich\JsonAssert\JsonAssertions; use TestHelpers\EmailHelper; use PHPUnit\Framework\Assert; use TestHelpers\GraphHelper; @@ -152,7 +151,7 @@ class NotificationContext implements Context { null, $this->getUserRecipient(), ); - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->featureContext->assertJsonDocumentMatchesSchema( $responseBody, $this->featureContext->getJSONSchema($schemaString) ); diff --git a/tests/acceptance/features/bootstrap/SpacesContext.php b/tests/acceptance/features/bootstrap/SpacesContext.php index 4608d43f05..30bdfe0270 100644 --- a/tests/acceptance/features/bootstrap/SpacesContext.php +++ b/tests/acceptance/features/bootstrap/SpacesContext.php @@ -27,7 +27,6 @@ use Behat\Behat\Hook\Scope\BeforeScenarioScope; use Behat\Gherkin\Node\PyStringNode; use Behat\Gherkin\Node\TableNode; use GuzzleHttp\Exception\GuzzleException; -use Helmich\JsonAssert\JsonAssertions; use Psr\Http\Message\ResponseInterface; use TestHelpers\HttpRequestHelper; use TestHelpers\WebDavHelper; @@ -921,7 +920,7 @@ class SpacesContext implements Context { $userName, ); - JsonAssertions::assertJsonDocumentMatchesSchema( + $this->featureContext->assertJsonDocumentMatchesSchema( $responseBody, $this->featureContext->getJSONSchema($schemaString) );