diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index cd991d2..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,22 +0,0 @@ ---- -engines: - duplication: - enabled: true - config: - languages: - - php - fixme: - enabled: true - phpcodesniffer: - enabled: true - phpmd: - enabled: true - checks: - CleanCode/StaticAccess: - enabled: false -ratings: - paths: - - "**.php" -exclude_paths: -- tests/**/* -- ".codeclimate.yml" diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml new file mode 100644 index 0000000..455b6a6 --- /dev/null +++ b/.github/workflows/php.yml @@ -0,0 +1,47 @@ +--- +name: Unit tests + +on: + push: + paths: + - '**.php' + - 'composer.json' + branches: + - 'v2' + pull_request: + paths: + - '**.php' + - 'composer.json' + branches: + - 'v2' + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + php: [ '7.0', '7.1' ] + name: PHP ${{ matrix.php }} + + steps: + - name: Git checkout + uses: actions/checkout@v2 + + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: json + + - name: Validate composer.json + run: composer validate + + - name: Setup problem matchers for PHPUnit + run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" + + - name: Install dependencies + run: composer update --prefer-dist --no-progress + + - name: Run unit tests + run: ./vendor/bin/phpunit diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6ba9645..0000000 --- a/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php -sudo: false -php: - - 7.3 - - 7.2 - - 7.1 -install: - - composer install --optimize-autoloader --prefer-dist --no-interaction -before_script: - - curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter - - chmod +x ./cc-test-reporter - - ./cc-test-reporter before-build -script: - - vendor/bin/phpunit --coverage-clover build/logs/clover.xml -after_script: - - ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT diff --git a/composer.json b/composer.json index 2716345..bc4d603 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=7.0", - "flow/jsonpath": "^0.4.0", + "softcreatr/jsonpath": "^0.5 || ^0.7", "justinrainbow/json-schema": "^5.0" }, "conflict": { diff --git a/src/Constraint/JsonValueMatches.php b/src/Constraint/JsonValueMatches.php index e135b5d..135a71f 100644 --- a/src/Constraint/JsonValueMatches.php +++ b/src/Constraint/JsonValueMatches.php @@ -77,7 +77,7 @@ protected function matches($other): bool foreach ($result as $v) { if ($v instanceof JSONPath) { - $v = $v->data(); + $v = $v->getData(); } $singleMatchResult = $this->constraint->evaluate($v, '', true);