Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "composer"
directory: "/" # Location of package manifests
schedule:
interval: "daily"
79 changes: 38 additions & 41 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
@@ -1,55 +1,52 @@
---
name: Unit tests

on:
push:
paths:
- '**.php'
- 'composer.json'
branches:
- 'master'
tags:
- '*'
- '!v1'
- '!v2'
pull_request:
paths:
- '**.php'
- 'composer.json'
branches:
- '*'
- '!v1'
- '!v2'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
php: ['7.2', '7.3', '7.4']
phpunit: ['8.0', '9.0']
composer-arg: ['']
include:
- php: '8.0'
phpunit: '9.0'
composer-arg: 'ignore-platform-req=php'
exclude:
- php: '8.0'
phpunit: '8.0'
- php: '7.2'
phpunit: '9.0'
runs-on: ubuntu-latest
php: [ '7.2', '7.3', '7.4', '8.0' ]
continue-on-error: ${{ matrix.php == '8.0' }}
name: PHP ${{ matrix.php }}, PHPUnit ${{ matrix.phpunit }}
name: PHP ${{ matrix.php }}

steps:
- uses: actions/checkout@v1

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php }}
extensions: mbstring, intl, json
coverage: pcov
tools: composer:v2
- name: Validate composer.json and composer.lock
run: composer validate

- name: Declare required PHPUnit version
run: |
composer require --no-update --dev phpunit/phpunit ~${{ matrix.phpunit }}

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest --${{ matrix.composer-arg }}

#- name: Run type checker
# run: ./vendor/bin/psalm

- name: Run unit tests
run: ./vendor/bin/phpunit --testdox
- 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
41 changes: 22 additions & 19 deletions .github/workflows/php_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,33 @@
name: Unit tests
---
name: Code Coverage

on:
push:
branches:
- 'master'

jobs:
coverage:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Git checkout
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: 7.4
extensions: mbstring, intl, json
coverage: pcov
- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v2.3.0
env:
CC_TEST_REPORTER_ID: ${{ secrets.codeClimateReporterID }}
with:
coverageCommand: ./vendor/bin/phpunit --coverage-clover=clover.xml
debug: true
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
extensions: json
coverage: pcov

- name: Install dependencies
run: composer update --prefer-dist --no-progress

- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v2.7.4
env:
CC_TEST_REPORTER_ID: ${{ secrets.codeClimateReporterID }}
with:
coverageCommand: ./vendor/bin/phpunit --coverage-clover=clover.xml
debug: true
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
],
"require": {
"php": "^7.2 || ^8.0",
"softcreatr/jsonpath": "^0.6.2",
"softcreatr/jsonpath": "^0.7.2",
"justinrainbow/json-schema": "^5.0"
},
"conflict": {
Expand Down
2 changes: 1 addition & 1 deletion src/Constraint/JsonValueMatches.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,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);
Expand Down