diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ecbf86d..9de019f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - php-version: ['7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3'] + php-version: ['8.1','8.2','8.3'] composer-prefer: - '--prefer-dist' - '--prefer-stable --prefer-lowest' @@ -17,7 +17,7 @@ jobs: name: Test PHP ${{ matrix.php-version }} / composer ${{matrix.composer-prefer}} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v5 - name: Setup PHP version ${{ matrix.php-version }} uses: shivammathur/setup-php@v2 @@ -45,7 +45,6 @@ jobs: - name: Run Code Style Check for PHP ${{ matrix.php-version }} run: composer run-script style-check - if: matrix.php-version != '7.1' - name: Run tests for PHP ${{ matrix.php-version }} run: composer run-script test @@ -56,4 +55,4 @@ jobs: run: vendor/bin/php-coveralls env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: success() && matrix.php-version == '7.4' + if: success() && matrix.php-version == '8.3' diff --git a/composer.json b/composer.json index 4ac909c..35cdf5b 100644 --- a/composer.json +++ b/composer.json @@ -3,15 +3,15 @@ "description": "A utility library for working with Table Schema", "license": "MIT", "require": { - "php": ">=7.1.0", + "php": ">=8.0", "ext-mbstring": "*", "ext-json": "*", - "justinrainbow/json-schema": "^5.2.10", + "justinrainbow/json-schema": "^6.6", "nesbot/carbon": "^2.63.0", "jmikola/geojson": "^1.0" }, "require-dev": { - "phpunit/phpunit": ">=7.5 <10.0", + "phpunit/phpunit": ">=9.3 <10.0", "php-coveralls/php-coveralls": "^2.4", "psy/psysh": "@stable", "roave/security-advisories": "dev-latest" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index ffe54a2..30f43ba 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,20 +1,17 @@ - - - - - - - - tests - - - - - - src - - + + + + src + + + + + + + + + tests + + diff --git a/src/SchemaValidator.php b/src/SchemaValidator.php index 881618b..c0cfd55 100644 --- a/src/SchemaValidator.php +++ b/src/SchemaValidator.php @@ -11,12 +11,12 @@ class SchemaValidator /** * @var object */ - private $descriptor; + protected $descriptor; /** * @var array */ - private $errors; + protected $errors; /** * @param object $descriptor diff --git a/tests/SchemaTest.php b/tests/SchemaTest.php index 30dc1e1..499fe48 100644 --- a/tests/SchemaTest.php +++ b/tests/SchemaTest.php @@ -584,9 +584,14 @@ public function testSpecsUriFormat(): void 'pointer' => '/0', // it considers file names to be invalid uris 'message' => 'Invalid URL format', - 'constraint' => 'format', - 'context' => 1, - 'format' => 'uri', + // Constraint errors are arrays since justinrainbow/json-schema:^6 + 'constraint' => [ + 'name' => 'urlFormat', + 'params' => [ + 'format' => 'uri' + ], + ], + 'context' => 1 ]], $validator->getErrors()); }