diff --git a/.atoum.php b/.atoum.php index 1e6824a..4383d34 100644 --- a/.atoum.php +++ b/.atoum.php @@ -10,8 +10,6 @@ [fr] http://docs.atoum.org/fr/latest/lancement_des_tests.html#fichier-de-configuration */ -use \mageekguy\atoum; - $report = $script->addDefaultReport(); // This will add a green or red logo after each run depending on its status. diff --git a/.bootstrap.atoum.php b/.bootstrap.atoum.php deleted file mode 100644 index 0577781..0000000 --- a/.bootstrap.atoum.php +++ /dev/null @@ -1,12 +0,0 @@ -jsonSchemaTools->createValidator(); - $refResolver = $this->jsonSchemaTools->createSchemaStorage(); + $schemaStorage = $this->jsonSchemaTools->createSchemaStorage(); $data = json_decode($payload); $delegateValidator->check( $data, - $refResolver->resolveRef('file://' . realpath($jsonSchemaFilename)) + $schemaStorage->resolveRef('file://' . realpath($jsonSchemaFilename)) ); if (!$delegateValidator->isValid()) { diff --git a/tests/Units/PayloadValidator.php b/tests/Units/PayloadValidator.php index 22346ec..28fbb70 100644 --- a/tests/Units/PayloadValidator.php +++ b/tests/Units/PayloadValidator.php @@ -12,9 +12,9 @@ public function test_validation_should_be_delegated_to_internal_validator() ->given( $validator = $this->mockJsonSchemaValidator(), $this->calling($validator)->check = null, - $refResolver = $this->mockJsonSchemaRefResolver(), - $this->calling($refResolver)->resolveRef = 'resolvedJsonSchema', - $jsonSchemaTools = $this->mockJsonSchemaTools($validator, $refResolver), + $schemaStorage = $this->mockJsonSchemaStorage(), + $this->calling($schemaStorage)->resolveRef = 'resolvedJsonSchema', + $jsonSchemaTools = $this->mockJsonSchemaTools($validator, $schemaStorage), $this->newTestedInstance($jsonSchemaTools) ) ->when( @@ -50,9 +50,9 @@ public function test_invalid_internal_validation_lead_to_exception() $this->calling($validator)->check = null, $this->calling($validator)->isValid = false, $this->calling($validator)->getErrors = ['error1', 'error2'], - $refResolver = $this->mockJsonSchemaRefResolver(), - $this->calling($refResolver)->resolve = 'resolvedJsonSchema', - $jsonSchemaTools = $this->mockJsonSchemaTools($validator, $refResolver), + $schemaStorage = $this->mockJsonSchemaStorage(), + $this->calling($schemaStorage)->resolveRef = 'resolvedJsonSchema', + $jsonSchemaTools = $this->mockJsonSchemaTools($validator, $schemaStorage), $this->newTestedInstance($jsonSchemaTools) ) ->exception(function () { @@ -71,19 +71,19 @@ private function mockJsonSchemaValidator() return new \mock\JsonSchema\Validator; } - private function mockJsonSchemaRefResolver() + private function mockJsonSchemaStorage() { $this->mockGenerator->orphanize('__construct'); - return new \mock\JsonSchema\JsonStorage(); + return new \mock\JsonSchema\SchemaStorage(); } - private function mockJsonSchemaTools($validator = null, $refResolver = null) + private function mockJsonSchemaTools($validator = null, $schemaStorage = null) { $this->mockGenerator->orphanize('__construct'); $mock = new \mock\Rezzza\SymfonyRestApiJson\JsonSchemaTools; $this->calling($mock)->createValidator = $validator; - $this->calling($mock)->createSchemaStorage = $refResolver; + $this->calling($mock)->createSchemaStorage = $schemaStorage; return $mock; }