Skip to content

Commit d0996c3

Browse files
committed
Upgrade phpunit & actions
1 parent 1310fcb commit d0996c3

File tree

5 files changed

+40
-38
lines changed

5 files changed

+40
-38
lines changed

.github/workflows/build.yml

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
name: Test
2-
on: [pull_request]
2+
on: [push, pull_request]
33

44
jobs:
55
psalm:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
8+
- uses: actions/checkout@v3
99

1010
- name: Psalm
1111
uses: docker://vimeo/psalm-github-actions
@@ -51,16 +51,16 @@ jobs:
5151
strategy:
5252
matrix:
5353
php:
54-
- 7.4
55-
- 8.0
54+
- 8.2
55+
- 8.3
5656
include:
57-
- php: 7.4
58-
phpunit: 9.5.0
59-
- php: 8.0
60-
phpunit: 9.5.0
57+
- php: 8.2
58+
phpunit: 10
59+
- php: 8.3
60+
phpunit: 10
6161

6262
steps:
63-
- uses: actions/checkout@v2
63+
- uses: actions/checkout@v3
6464

6565
- name: Cache Composer dependencies
6666
uses: actions/cache@v2
@@ -72,7 +72,13 @@ jobs:
7272
with:
7373
php_version: ${{ matrix.php }}
7474

75-
- uses: php-actions/phpunit@v9
75+
- uses: php-actions/phpunit@v3
7676
with:
7777
php_version: ${{ matrix.php }}
7878
version: ${{ matrix.phpunit }}
79+
php_extensions: xdebug
80+
coverage_text: true
81+
bootstrap: vendor/autoload.php
82+
args: --coverage-filter src tests
83+
env:
84+
XDEBUG_MODE: coverage

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"ext-json": "*"
2020
},
2121
"require-dev": {
22-
"phpunit/phpunit": "^9",
22+
"phpunit/phpunit": "^10",
2323
"codacy/coverage": "dev-master",
2424
"symfony/http-foundation": "^2.8|^3.0|^5.0"
2525
},

phpunit.xml.dist

+16-20
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
3-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4-
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
5-
backupGlobals="false"
6-
colors="true"
7-
bootstrap="./vendor/autoload.php">
8-
<testsuites>
9-
<testsuite name="phpunit-json-assertions Test Suite">
10-
<directory>tests/</directory>
11-
</testsuite>
12-
</testsuites>
13-
14-
<coverage>
15-
<include>
16-
<directory suffix=".php">src/</directory>
17-
</include>
18-
<report>
19-
<clover outputFile="./build/logs/clover.xml"/>
20-
</report>
21-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupGlobals="false" colors="true" bootstrap="./vendor/autoload.php">
3+
<testsuites>
4+
<testsuite name="phpunit-json-assertions Test Suite">
5+
<directory>tests/</directory>
6+
</testsuite>
7+
</testsuites>
8+
<coverage>
9+
<report>
10+
<clover outputFile="./build/logs/clover.xml"/>
11+
</report>
12+
</coverage>
13+
<source>
14+
<include>
15+
<directory suffix=".php">src/</directory>
16+
</include>
17+
</source>
2218
</phpunit>

tests/AssertClassTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ class AssertClassTest extends TestCase
1818
{
1919
public function testClassInstance()
2020
{
21-
static::assertInstanceOf('EnricoStahn\JsonAssert\AssertClass', new AssertClass());
21+
static::assertInstanceOf('EnricoStahn\JsonAssert\AssertClass', new AssertClass('AssertClassTest'));
2222
}
2323
}

tests/AssertTraitTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ public function testAssertJsonMatchesSchemaString()
256256
* @dataProvider assertJsonValueEqualsProvider
257257
*
258258
* @param string $expression
259-
* @param mixed $value
259+
* @param mixed $value
260260
*/
261261
public function testAssertJsonValueEquals(string $expression, $value)
262262
{
@@ -267,16 +267,16 @@ public function testAssertJsonValueEquals(string $expression, $value)
267267

268268
public function testAssertWithSchemaStore()
269269
{
270-
$obj = new AssertTraitImpl();
270+
$obj = new AssertTraitImpl('testAssertWithSchemaStore');
271271
$obj->setUp();
272272

273-
$schemaStore = $obj->testWithSchemaStore('foobar', (object)['type' => 'string']);
273+
$schemaStore = $obj->testWithSchemaStore('foobar', (object) ['type' => 'string']);
274274

275275
self::assertInstanceOf('JsonSchema\SchemaStorage', $schemaStore);
276-
self::assertEquals($schemaStore->getSchema('foobar'), (object)['type' => 'string']);
276+
self::assertEquals($schemaStore->getSchema('foobar'), (object) ['type' => 'string']);
277277
}
278278

279-
public function assertJsonValueEqualsProvider(): array
279+
public static function assertJsonValueEqualsProvider(): array
280280
{
281281
return [
282282
['foo', '123'],
@@ -300,7 +300,7 @@ public function testGetJsonObject($expected, $actual)
300300
self::assertEquals($expected, AssertTraitImpl::getJsonObject($actual));
301301
}
302302

303-
public function jsonObjectProvider(): array
303+
public static function jsonObjectProvider(): array
304304
{
305305
return [
306306
[[], []],

0 commit comments

Comments
 (0)