Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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'

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
Expand Down Expand Up @@ -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
Expand All @@ -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'
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
33 changes: 15 additions & 18 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/7.5/phpunit.xsd"
bootstrap="vendor/autoload.php">
<php>
<ini name="display_errors" value="On" />
<ini name="error_reporting" value="24575" />
</php>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src</directory>
</whitelist>
</filter>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="vendor/autoload.php">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">src</directory>
</include>
</coverage>
<php>
<ini name="display_errors" value="On"/>
<ini name="error_reporting" value="24575"/>
</php>
<testsuites>
<testsuite name="default">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
4 changes: 2 additions & 2 deletions src/SchemaValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ class SchemaValidator
/**
* @var object
*/
private $descriptor;
protected $descriptor;

/**
* @var array
*/
private $errors;
protected $errors;

/**
* @param object $descriptor
Expand Down
11 changes: 8 additions & 3 deletions tests/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down