Skip to content

Commit dc7a8a0

Browse files
committed
Added support for PHPUnit 11.
1 parent 6e1f884 commit dc7a8a0

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

.github/workflows/Test.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ jobs:
1818
- 8.1
1919
- 8.2
2020
- 8.3
21+
phpunit:
22+
- 10
23+
- 11
24+
exclude:
25+
- php: 8.1
26+
phpunit: 11
2127

2228
steps:
2329
- uses: actions/checkout@v4
@@ -28,6 +34,10 @@ jobs:
2834
php-version: ${{ matrix.php }}
2935
coverage: pcov
3036

37+
- name: Filter PHPUnit version constraint
38+
run: 'sed -i ''s/\("phpunit\/phpunit" *: *\)\("\||\).*\(\^${{ matrix.phpunit }}\b[^|"]*\)\(|\|"\).*/\1"\3"/''
39+
composer.json'
40+
3141
- name: Validate composer.json
3242
run: composer validate
3343

@@ -36,7 +46,7 @@ jobs:
3646
uses: actions/cache@v4
3747
with:
3848
path: vendor
39-
key: php-${{ matrix.php }}
49+
key: php-${{ matrix.php }}-${{ matrix.phpunit }}
4050

4151
- name: Install dependencies
4252
run: composer update --no-interaction --no-progress

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
],
1010
"require": {
1111
"php": ">=8.1",
12-
"phpunit/phpunit": "^10.5.28"
12+
"phpunit/phpunit": "^10.5.28|^11.2.8"
1313
},
1414
"autoload": {
1515
"psr-4": {

test/CapabilitiesTest.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
namespace ScriptFUSIONTest\Pip;
33

4+
use PHPUnit\Framework\Attributes\DataProvider;
45
use PHPUnit\Framework\TestCase;
56

67
/**
@@ -74,9 +75,8 @@ function unserialize(string $data) {}
7475
self::assertTrue(true);
7576
}
7677

77-
/**
78-
* @dataProvider provideData
79-
*/
78+
#[DataProvider('provideData')]
79+
8080
public function testDataProvider(): void
8181
{
8282
self::assertTrue(true);
@@ -90,9 +90,7 @@ public static function provideData(): iterable
9090
];
9191
}
9292

93-
/**
94-
* @dataProvider provideSuccessesAndFailures
95-
*/
93+
#[DataProvider('provideSuccessesAndFailures')]
9694
public function testSuccessAfterFailure($bool): void
9795
{
9896
self::assertTrue($bool);

0 commit comments

Comments
 (0)