diff --git a/.php_cs.dist b/.php_cs.dist index 6b7d9b92..c4e84b4e 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -1,7 +1,7 @@ in(__DIR__); /* Based on ^2.1 of php-cs-fixer */ @@ -15,7 +15,7 @@ $config 'array_syntax' => array('syntax' => 'long'), 'binary_operator_spaces' => false, 'concat_space' => array('spacing' => 'one'), - 'no_unused_imports' => false, + 'increment_style' => false, 'no_useless_else' => true, 'no_useless_return' => true, 'ordered_imports' => true, @@ -23,8 +23,8 @@ $config 'phpdoc_order' => true, 'phpdoc_summary' => false, 'pre_increment' => false, - 'trailing_comma_in_multiline_array' => false, 'simplified_null_return' => false, + 'trailing_comma_in_multiline_array' => false, 'yoda_style' => null, )) ->setFinder($finder) diff --git a/.travis.yml b/.travis.yml index 3462c9f3..ebf29d24 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,9 @@ sudo: false language: php cache: - directories: - - $HOME/.composer/cache - - $HOME/.phpcsfixer + directories: + - $HOME/.composer/cache + - $HOME/.phpcsfixer matrix: fast_finish: true @@ -17,6 +17,7 @@ matrix: - php: 7.0 env: WITH_COVERAGE=true WITH_PHPCSFIXER=true - php: 7.1 + - php: 7.2 - php: 'nightly' - php: hhvm dist: trusty @@ -25,7 +26,6 @@ matrix: before_install: - if [[ "$WITH_COVERAGE" != "true" && "$TRAVIS_PHP_VERSION" != "hhvm" && "$TRAVIS_PHP_VERSION" != "nightly" && "$TRAVIS_PHP_VERSION" != "7.1" ]]; then phpenv config-rm xdebug.ini; fi - - composer selfupdate - if [[ "$TRAVIS_PHP_VERSION" = "hhvm" || "$TRAVIS_PHP_VERSION" = "nightly" ]]; then sed -i '/^.*friendsofphp\/php-cs-fixer.*$/d' composer.json; fi install: diff --git a/composer.json b/composer.json index 009c1485..6e72ab9b 100644 --- a/composer.json +++ b/composer.json @@ -41,7 +41,7 @@ "require-dev": { "json-schema/JSON-Schema-Test-Suite": "1.2.0", "friendsofphp/php-cs-fixer": "^2.1", - "phpunit/phpunit": "^4.8.22" + "phpunit/phpunit": "^4.8.35" }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" } @@ -56,10 +56,10 @@ } }, "scripts": { - "test" : "vendor/bin/phpunit", - "testOnly" : "vendor/bin/phpunit --colors --filter", - "coverage" : "vendor/bin/phpunit --coverage-text", - "style-check" : "vendor/bin/php-cs-fixer fix --dry-run --verbose --diff", - "style-fix" : "vendor/bin/php-cs-fixer fix --verbose" + "test" : "phpunit", + "testOnly" : "phpunit --colors --filter", + "coverage" : "phpunit --coverage-text", + "style-check" : "php-cs-fixer fix --dry-run --verbose --diff", + "style-fix" : "php-cs-fixer fix --verbose" } } diff --git a/src/JsonSchema/Constraints/Constraint.php b/src/JsonSchema/Constraints/Constraint.php index e50c7d0b..a53130df 100644 --- a/src/JsonSchema/Constraints/Constraint.php +++ b/src/JsonSchema/Constraints/Constraint.php @@ -10,9 +10,6 @@ namespace JsonSchema\Constraints; use JsonSchema\Entity\JsonPointer; -use JsonSchema\SchemaStorage; -use JsonSchema\Uri\UriRetriever; -use JsonSchema\UriRetrieverInterface; /** * The Base Constraints, all Validators should extend this class diff --git a/src/JsonSchema/Constraints/Factory.php b/src/JsonSchema/Constraints/Factory.php index c9296385..4e771c19 100644 --- a/src/JsonSchema/Constraints/Factory.php +++ b/src/JsonSchema/Constraints/Factory.php @@ -9,9 +9,7 @@ namespace JsonSchema\Constraints; -use JsonSchema\Constraints\Constraint; use JsonSchema\Exception\InvalidArgumentException; -use JsonSchema\Exception\InvalidConfigException; use JsonSchema\SchemaStorage; use JsonSchema\SchemaStorageInterface; use JsonSchema\Uri\UriRetriever; diff --git a/src/JsonSchema/Constraints/SchemaConstraint.php b/src/JsonSchema/Constraints/SchemaConstraint.php index eed53956..db665ad3 100644 --- a/src/JsonSchema/Constraints/SchemaConstraint.php +++ b/src/JsonSchema/Constraints/SchemaConstraint.php @@ -13,7 +13,6 @@ use JsonSchema\Exception\InvalidArgumentException; use JsonSchema\Exception\InvalidSchemaException; use JsonSchema\Exception\RuntimeException; -use JsonSchema\SchemaStorage; use JsonSchema\Validator; /** diff --git a/src/JsonSchema/Constraints/UndefinedConstraint.php b/src/JsonSchema/Constraints/UndefinedConstraint.php index c0606ff9..257db155 100644 --- a/src/JsonSchema/Constraints/UndefinedConstraint.php +++ b/src/JsonSchema/Constraints/UndefinedConstraint.php @@ -243,6 +243,7 @@ protected function applyDefaultValues(&$value, $schema, $path) if (isset($schema->properties) && LooseTypeCheck::isObject($value)) { // $value is an object or assoc array, and properties are defined - treat as an object foreach ($schema->properties as $currentProperty => $propertyDefinition) { + $propertyDefinition = $this->factory->getSchemaStorage()->resolveRefSchema($propertyDefinition); if ( !LooseTypeCheck::propertyExists($value, $currentProperty) && property_exists($propertyDefinition, 'default') @@ -266,6 +267,7 @@ protected function applyDefaultValues(&$value, $schema, $path) } // $value is an array, and items are defined - treat as plain array foreach ($items as $currentItem => $itemDefinition) { + $itemDefinition = $this->factory->getSchemaStorage()->resolveRefSchema($itemDefinition); if ( !array_key_exists($currentItem, $value) && property_exists($itemDefinition, 'default') diff --git a/src/JsonSchema/Validator.php b/src/JsonSchema/Validator.php index 0e3b4709..448091cd 100644 --- a/src/JsonSchema/Validator.php +++ b/src/JsonSchema/Validator.php @@ -11,8 +11,6 @@ use JsonSchema\Constraints\BaseConstraint; use JsonSchema\Constraints\Constraint; -use JsonSchema\Exception\InvalidConfigException; -use JsonSchema\SchemaStorage; /** * A JsonSchema Constraint diff --git a/tests/Constraints/CoerciveTest.php b/tests/Constraints/CoerciveTest.php index e4dd173d..ea8a2842 100644 --- a/tests/Constraints/CoerciveTest.php +++ b/tests/Constraints/CoerciveTest.php @@ -12,7 +12,6 @@ use JsonSchema\Constraints\Constraint; use JsonSchema\Constraints\Factory; use JsonSchema\SchemaStorage; -use JsonSchema\Uri\UriResolver; use JsonSchema\Validator; class CoerciveTest extends BasicTypesTest diff --git a/tests/Constraints/DefaultPropertiesTest.php b/tests/Constraints/DefaultPropertiesTest.php index bcf90b2c..6cdce8bb 100644 --- a/tests/Constraints/DefaultPropertiesTest.php +++ b/tests/Constraints/DefaultPropertiesTest.php @@ -121,12 +121,12 @@ public function getValidTests() ), array(// #15 infinite recursion via $ref (object) '{}', - '{"properties":{"propertyOne": {"$ref": "#","default": {}}}}', + '{"properties":{"propertyOne": {"$ref": "#","default": {}}}, "default": "valueOne"}', '{"propertyOne":{}}' ), array(// #16 infinite recursion via $ref (array) '[]', - '{"items":[{"$ref":"#","default":[]}]}', + '{"items":[{"$ref":"#","default":[]}], "default": "valueOne"}', '[[]]' ), array(// #17 default top value does not overwrite defined null diff --git a/tests/Constraints/FactoryTest.php b/tests/Constraints/FactoryTest.php index 4f13bcf6..ac2a91fb 100644 --- a/tests/Constraints/FactoryTest.php +++ b/tests/Constraints/FactoryTest.php @@ -12,7 +12,7 @@ use JsonSchema\Constraints\Constraint; use JsonSchema\Constraints\Factory; use JsonSchema\Entity\JsonPointer; -use PHPUnit_Framework_TestCase as TestCase; +use PHPUnit\Framework\TestCase; /** * Class MyBadConstraint diff --git a/tests/Constraints/FormatTest.php b/tests/Constraints/FormatTest.php index b035aafe..78706c33 100644 --- a/tests/Constraints/FormatTest.php +++ b/tests/Constraints/FormatTest.php @@ -77,7 +77,7 @@ public function testInvalidFormat($string, $format) $schema->format = $format; $validator->check($string, $schema); - $this->assertEquals(1, count($validator->getErrors()), 'Expected 1 error'); + $this->assertCount(1, $validator->getErrors(), 'Expected 1 error'); } /** diff --git a/tests/Constraints/LongArraysTest.php b/tests/Constraints/LongArraysTest.php index 2757b964..c60fd3c7 100644 --- a/tests/Constraints/LongArraysTest.php +++ b/tests/Constraints/LongArraysTest.php @@ -100,11 +100,4 @@ public function testLongIntegerArray() $validator->check($checkValue, $schema); $this->assertTrue($validator->isValid(), print_r($validator->getErrors(), true)); } - - private static function millis() - { - $mt = explode(' ', microtime()); - - return $mt[1] * 1000 + round($mt[0] * 1000); - } } diff --git a/tests/Constraints/PointerTest.php b/tests/Constraints/PointerTest.php index 88e5247d..a8143a6b 100644 --- a/tests/Constraints/PointerTest.php +++ b/tests/Constraints/PointerTest.php @@ -10,8 +10,9 @@ namespace JsonSchema\Tests\Constraints; use JsonSchema\Validator; +use PHPUnit\Framework\TestCase; -class PointerTest extends \PHPUnit_Framework_TestCase +class PointerTest extends TestCase { protected $validateSchema = true; diff --git a/tests/Constraints/SchemaValidationTest.php b/tests/Constraints/SchemaValidationTest.php index 356637ae..85907c5d 100644 --- a/tests/Constraints/SchemaValidationTest.php +++ b/tests/Constraints/SchemaValidationTest.php @@ -11,8 +11,9 @@ use JsonSchema\Constraints\Constraint; use JsonSchema\Validator; +use PHPUnit\Framework\TestCase; -class SchemaValidationTest extends \PHPUnit_Framework_TestCase +class SchemaValidationTest extends TestCase { protected $validateSchema = true; diff --git a/tests/Constraints/TypeTest.php b/tests/Constraints/TypeTest.php index 24138478..ca6bf7cf 100644 --- a/tests/Constraints/TypeTest.php +++ b/tests/Constraints/TypeTest.php @@ -11,6 +11,7 @@ use JsonSchema\Constraints\TypeCheck\LooseTypeCheck; use JsonSchema\Constraints\TypeConstraint; +use PHPUnit\Framework\TestCase; /** * Class TypeTest @@ -19,7 +20,7 @@ * * @author hakre */ -class TypeTest extends \PHPUnit_Framework_TestCase +class TypeTest extends TestCase { /** * @see testIndefiniteArticleForTypeInTypeCheckErrorMessage @@ -57,7 +58,7 @@ public function testIndefiniteArticleForTypeInTypeCheckErrorMessage($type, $word */ public function testLooseTypeChecking() { - $v = new \StdClass(); + $v = new \stdClass(); $v->property = 'dataOne'; LooseTypeCheck::propertySet($v, 'property', 'dataTwo'); $this->assertEquals('dataTwo', $v->property); @@ -110,7 +111,7 @@ public function testValidateTypeNameWording() public function testValidateTypeException() { $t = new TypeConstraint(); - $data = new \StdClass(); + $data = new \stdClass(); $schema = json_decode('{"type": "notAValidTypeName"}'); $this->setExpectedException( diff --git a/tests/Constraints/ValidationExceptionTest.php b/tests/Constraints/ValidationExceptionTest.php index 6a7076bb..57995769 100644 --- a/tests/Constraints/ValidationExceptionTest.php +++ b/tests/Constraints/ValidationExceptionTest.php @@ -12,8 +12,9 @@ use JsonSchema\Constraints\Constraint; use JsonSchema\Exception\ValidationException; use JsonSchema\Validator; +use PHPUnit\Framework\TestCase; -class ValidationExceptionTest extends \PHPUnit_Framework_TestCase +class ValidationExceptionTest extends TestCase { public function testValidationException() { diff --git a/tests/Constraints/VeryBaseTestCase.php b/tests/Constraints/VeryBaseTestCase.php index 7cc0d1c6..7cd7c06b 100644 --- a/tests/Constraints/VeryBaseTestCase.php +++ b/tests/Constraints/VeryBaseTestCase.php @@ -9,12 +9,13 @@ namespace JsonSchema\Tests\Constraints; +use PHPUnit\Framework\TestCase; use Prophecy\Argument; /** * @package JsonSchema\Tests\Constraints */ -abstract class VeryBaseTestCase extends \PHPUnit_Framework_TestCase +abstract class VeryBaseTestCase extends TestCase { /** @var object */ private $jsonSchemaDraft03; diff --git a/tests/Drafts/Draft3Test.php b/tests/Drafts/Draft3Test.php index 1942a3b1..84d2353f 100644 --- a/tests/Drafts/Draft3Test.php +++ b/tests/Drafts/Draft3Test.php @@ -9,8 +9,6 @@ namespace JsonSchema\Tests\Drafts; -use JsonSchema\Constraints\Constraint; - /** * @package JsonSchema\Tests\Drafts */ diff --git a/tests/Entity/JsonPointerTest.php b/tests/Entity/JsonPointerTest.php index 65859895..d063d32d 100644 --- a/tests/Entity/JsonPointerTest.php +++ b/tests/Entity/JsonPointerTest.php @@ -10,13 +10,14 @@ namespace JsonSchema\Tests\Entity; use JsonSchema\Entity\JsonPointer; +use PHPUnit\Framework\TestCase; /** * @package JsonSchema\Tests\Entity * * @author Joost Nijhuis */ -class JsonPointerTest extends \PHPUnit_Framework_TestCase +class JsonPointerTest extends TestCase { /** * @dataProvider getTestData diff --git a/tests/Exception/InvalidArgumentExceptionTest.php b/tests/Exception/InvalidArgumentExceptionTest.php index 52456f28..5715fbac 100644 --- a/tests/Exception/InvalidArgumentExceptionTest.php +++ b/tests/Exception/InvalidArgumentExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\InvalidArgumentException; +use PHPUnit\Framework\TestCase; -class InvalidArgumentExceptionTest extends \PHPUnit_Framework_TestCase +class InvalidArgumentExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/InvalidSchemaMediaTypeExceptionTest.php b/tests/Exception/InvalidSchemaMediaTypeExceptionTest.php index ebebccbd..6b12adc6 100644 --- a/tests/Exception/InvalidSchemaMediaTypeExceptionTest.php +++ b/tests/Exception/InvalidSchemaMediaTypeExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\InvalidSchemaMediaTypeException; +use PHPUnit\Framework\TestCase; -class InvalidSchemaMediaTypeExceptionTest extends \PHPUnit_Framework_TestCase +class InvalidSchemaMediaTypeExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/InvalidSourceUriExceptionTest.php b/tests/Exception/InvalidSourceUriExceptionTest.php index 676cce37..7cccf817 100644 --- a/tests/Exception/InvalidSourceUriExceptionTest.php +++ b/tests/Exception/InvalidSourceUriExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\InvalidSourceUriException; +use PHPUnit\Framework\TestCase; -class InvalidSourceUriExceptionTest extends \PHPUnit_Framework_TestCase +class InvalidSourceUriExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/JsonDecodingExceptionTest.php b/tests/Exception/JsonDecodingExceptionTest.php index bd9ccb6f..667c6520 100644 --- a/tests/Exception/JsonDecodingExceptionTest.php +++ b/tests/Exception/JsonDecodingExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\JsonDecodingException; +use PHPUnit\Framework\TestCase; -class JsonDecodingExceptionTest extends \PHPUnit_Framework_TestCase +class JsonDecodingExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/ResourceNotFoundExceptionTest.php b/tests/Exception/ResourceNotFoundExceptionTest.php index aaeac961..2cde0eec 100644 --- a/tests/Exception/ResourceNotFoundExceptionTest.php +++ b/tests/Exception/ResourceNotFoundExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\ResourceNotFoundException; +use PHPUnit\Framework\TestCase; -class ResourceNotFoundExceptionTest extends \PHPUnit_Framework_TestCase +class ResourceNotFoundExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/RuntimeExceptionTest.php b/tests/Exception/RuntimeExceptionTest.php index c9800953..4db22eaa 100644 --- a/tests/Exception/RuntimeExceptionTest.php +++ b/tests/Exception/RuntimeExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\RuntimeException; +use PHPUnit\Framework\TestCase; -class RuntimeExceptionTest extends \PHPUnit_Framework_TestCase +class RuntimeExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/UnresolvableJsonPointerExceptionTest.php b/tests/Exception/UnresolvableJsonPointerExceptionTest.php index 61b40779..f061d9da 100644 --- a/tests/Exception/UnresolvableJsonPointerExceptionTest.php +++ b/tests/Exception/UnresolvableJsonPointerExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\UnresolvableJsonPointerException; +use PHPUnit\Framework\TestCase; -class UnresolvableJsonPointerExceptionTest extends \PHPUnit_Framework_TestCase +class UnresolvableJsonPointerExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Exception/UriResolverExceptionTest.php b/tests/Exception/UriResolverExceptionTest.php index a9cdef9f..eb9af83f 100644 --- a/tests/Exception/UriResolverExceptionTest.php +++ b/tests/Exception/UriResolverExceptionTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Exception; use JsonSchema\Exception\UriResolverException; +use PHPUnit\Framework\TestCase; -class UriResolverExceptionTest extends \PHPUnit_Framework_TestCase +class UriResolverExceptionTest extends TestCase { public function testHierarchy() { diff --git a/tests/Iterators/ObjectIteratorTest.php b/tests/Iterators/ObjectIteratorTest.php index 703df833..e36d2ea4 100644 --- a/tests/Iterators/ObjectIteratorTest.php +++ b/tests/Iterators/ObjectIteratorTest.php @@ -10,8 +10,9 @@ namespace JsonSchema\Tests\Iterators; use JsonSchema\Iterator\ObjectIterator; +use PHPUnit\Framework\TestCase; -class ObjectIteratorTest extends \PHPUnit_Framework_TestCase +class ObjectIteratorTest extends TestCase { protected $testObject; diff --git a/tests/Rfc3339Test.php b/tests/Rfc3339Test.php index 13294d0a..e489d389 100644 --- a/tests/Rfc3339Test.php +++ b/tests/Rfc3339Test.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests; use JsonSchema\Rfc3339; +use PHPUnit\Framework\TestCase; -class Rfc3339Test extends \PHPUnit_Framework_TestCase +class Rfc3339Test extends TestCase { /** * @param string $string diff --git a/tests/SchemaStorageTest.php b/tests/SchemaStorageTest.php index 2393f29d..0c31e86a 100644 --- a/tests/SchemaStorageTest.php +++ b/tests/SchemaStorageTest.php @@ -12,9 +12,9 @@ use JsonSchema\SchemaStorage; use JsonSchema\Uri\UriRetriever; use JsonSchema\Validator; -use Prophecy\Argument; +use PHPUnit\Framework\TestCase; -class SchemaStorageTest extends \PHPUnit_Framework_TestCase +class SchemaStorageTest extends TestCase { public function testResolveRef() { @@ -113,7 +113,7 @@ public function testUnresolvableJsonPointExceptionShouldBeThrown() $uriRetriever = $this->prophesize('JsonSchema\UriRetrieverInterface'); $uriRetriever->retrieve($mainSchemaPath) ->willReturn($mainSchema) - ->shouldBeCalled($mainSchema); + ->shouldBeCalled(); $schemaStorage = new SchemaStorage($uriRetriever->reveal()); $schemaStorage->resolveRef("$mainSchemaPath#/definitions/car"); diff --git a/tests/Uri/Retrievers/CurlTest.php b/tests/Uri/Retrievers/CurlTest.php index f833b590..550baff1 100644 --- a/tests/Uri/Retrievers/CurlTest.php +++ b/tests/Uri/Retrievers/CurlTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Uri\Retrievers { use JsonSchema\Uri\Retrievers\Curl; + use PHPUnit\Framework\TestCase; - class CurlTest extends \PHPUnit_Framework_TestCase + class CurlTest extends TestCase { public function testRetrieveFile() { diff --git a/tests/Uri/Retrievers/FileGetContentsTest.php b/tests/Uri/Retrievers/FileGetContentsTest.php index d9b06263..0514a7d5 100644 --- a/tests/Uri/Retrievers/FileGetContentsTest.php +++ b/tests/Uri/Retrievers/FileGetContentsTest.php @@ -3,11 +3,12 @@ namespace JsonSchema\Tests\Uri\Retrievers { use JsonSchema\Uri\Retrievers\FileGetContents; + use PHPUnit\Framework\TestCase; /** * @group FileGetContents */ - class FileGetContentsTest extends \PHPUnit_Framework_TestCase + class FileGetContentsTest extends TestCase { /** * @expectedException \JsonSchema\Exception\ResourceNotFoundException diff --git a/tests/Uri/Retrievers/PredefinedArrayTest.php b/tests/Uri/Retrievers/PredefinedArrayTest.php index e92908a2..7684bb1f 100644 --- a/tests/Uri/Retrievers/PredefinedArrayTest.php +++ b/tests/Uri/Retrievers/PredefinedArrayTest.php @@ -3,11 +3,12 @@ namespace JsonSchema\Tests\Uri\Retrievers; use JsonSchema\Uri\Retrievers\PredefinedArray; +use PHPUnit\Framework\TestCase; /** * @group PredefinedArray */ -class PredefinedArrayTest extends \PHPUnit_Framework_TestCase +class PredefinedArrayTest extends TestCase { private $retriever; diff --git a/tests/Uri/UriResolverTest.php b/tests/Uri/UriResolverTest.php index 051c2a58..a353de50 100644 --- a/tests/Uri/UriResolverTest.php +++ b/tests/Uri/UriResolverTest.php @@ -3,8 +3,9 @@ namespace JsonSchema\Tests\Uri; use JsonSchema\Uri\UriResolver; +use PHPUnit\Framework\TestCase; -class UriResolverTest extends \PHPUnit_Framework_TestCase +class UriResolverTest extends TestCase { public function setUp() { diff --git a/tests/Uri/UriRetrieverTest.php b/tests/Uri/UriRetrieverTest.php index f5db5ca1..c95fc923 100644 --- a/tests/Uri/UriRetrieverTest.php +++ b/tests/Uri/UriRetrieverTest.php @@ -12,11 +12,12 @@ use JsonSchema\Exception\JsonDecodingException; use JsonSchema\Uri\UriRetriever; use JsonSchema\Validator; +use PHPUnit\Framework\TestCase; /** * @group UriRetriever */ -class UriRetrieverTest extends \PHPUnit_Framework_TestCase +class UriRetrieverTest extends TestCase { protected $validator; @@ -25,7 +26,7 @@ protected function setUp() $this->validator = new Validator(); } - private function getRetrieverMock($returnSchema, $returnMediaType = Validator::SCHEMA_MEDIA_TYPE) + private function getRetrieverMock($returnSchema) { $jsonSchema = json_decode($returnSchema); diff --git a/tests/ValidatorTest.php b/tests/ValidatorTest.php index 73688537..6ecb4c69 100644 --- a/tests/ValidatorTest.php +++ b/tests/ValidatorTest.php @@ -2,10 +2,10 @@ namespace JsonSchema\Tests; -use JsonSchema\Constraints\Constraint; use JsonSchema\Validator; +use PHPUnit\Framework\TestCase; -class ValidatorTest extends \PHPUnit_Framework_TestCase +class ValidatorTest extends TestCase { public function testValidateWithAssocSchema() {