File tree 8 files changed +46
-9
lines changed 8 files changed +46
-9
lines changed Original file line number Diff line number Diff line change 3
3
/.gitignore export-ignore
4
4
/examples / export-ignore
5
5
/phpunit.xml.dist export-ignore
6
+ /phpunit.xml.legacy export-ignore
6
7
/tests / export-ignore
Original file line number Diff line number Diff line change 11
11
strategy :
12
12
matrix :
13
13
php :
14
+ - 8.0
14
15
- 7.4
15
16
- 7.3
16
17
- 7.2
28
29
coverage : xdebug
29
30
- run : composer install
30
31
- run : vendor/bin/phpunit --coverage-text
32
+ if : ${{ matrix.php >= 7.3 }}
33
+ - run : vendor/bin/phpunit --coverage-text -c phpunit.xml.legacy
34
+ if : ${{ matrix.php < 7.3 }}
31
35
32
36
PHPUnit-hhvm :
33
37
name : PHPUnit (HHVM)
Original file line number Diff line number Diff line change @@ -240,7 +240,7 @@ $ composer require clue/packagist-api-react:^1.3
240
240
See also the [ CHANGELOG] ( CHANGELOG.md ) for details about version upgrades.
241
241
242
242
This project aims to run on any platform and thus does not require any PHP
243
- extensions and supports running on legacy PHP 5.3 through current PHP 7 + and
243
+ extensions and supports running on legacy PHP 5.3 through current PHP 8 + and
244
244
HHVM.
245
245
It's * highly recommended to use PHP 7+* for this project.
246
246
Original file line number Diff line number Diff line change 17
17
"rize/uri-template" : " ^0.3"
18
18
},
19
19
"require-dev" : {
20
- "phpunit/phpunit" : " ^7.0 || ^6.0 || ^5.7 || ^4.8.35"
20
+ "phpunit/phpunit" : " ^9.3 || ^5.7 || ^4.8.35"
21
21
},
22
22
"autoload" : {
23
23
"psr-4" : { "Clue\\ React\\ Packagist\\ Api\\ " : " src/" }
Original file line number Diff line number Diff line change 1
1
<?xml version =" 1.0" encoding =" UTF-8" ?>
2
2
3
- <phpunit bootstrap =" vendor/autoload.php" colors =" true" >
3
+ <!-- PHPUnit configuration file with new format for PHPUnit 9.3+ -->
4
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd"
6
+ bootstrap =" vendor/autoload.php"
7
+ colors =" true"
8
+ cacheResult =" false" >
4
9
<testsuites >
5
10
<testsuite name =" Packagist React Test Suite" >
6
11
<directory >./tests/</directory >
7
12
</testsuite >
8
13
</testsuites >
9
- <filter >
10
- <whitelist >
14
+ <coverage >
15
+ <include >
11
16
<directory >./src/</directory >
12
- </whitelist >
13
- </filter >
17
+ </include >
18
+ </coverage >
14
19
</phpunit >
Original file line number Diff line number Diff line change
1
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2
+
3
+ <!-- PHPUnit configuration file with old format for PHPUnit 9.2 or older -->
4
+ <phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
+ xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/4.8/phpunit.xsd"
6
+ bootstrap =" vendor/autoload.php"
7
+ colors =" true" >
8
+ <testsuites >
9
+ <testsuite name =" Packagist React Test Suite" >
10
+ <directory >./tests/</directory >
11
+ </testsuite >
12
+ </testsuites >
13
+ <filter >
14
+ <whitelist >
15
+ <directory >./src/</directory >
16
+ </whitelist >
17
+ </filter >
18
+ </phpunit >
Original file line number Diff line number Diff line change @@ -12,7 +12,10 @@ class ClientTest extends TestCase
12
12
private $ browser ;
13
13
private $ client ;
14
14
15
- public function setUp ()
15
+ /**
16
+ * @before
17
+ */
18
+ public function setUpClient ()
16
19
{
17
20
$ this ->browser = $ this ->getMockBuilder ('Clue\React\Buzz\Browser ' )->disableOriginalConstructor ()->getMock ();
18
21
$ this ->browser ->expects ($ this ->any ())->method ('withBase ' )->willReturn ($ this ->browser );
Original file line number Diff line number Diff line change @@ -46,7 +46,13 @@ protected function expectCallableOnceParameter($type)
46
46
47
47
protected function createCallableMock ()
48
48
{
49
- return $ this ->getMockBuilder ('stdClass ' )->setMethods (array ('__invoke ' ))->getMock ();
49
+ if (method_exists ('PHPUnit\Framework\MockObject\MockBuilder ' , 'addMethods ' )) {
50
+ // PHPUnit 8.5+
51
+ return $ this ->getMockBuilder ('stdClass ' )->addMethods (array ('__invoke ' ))->getMock ();
52
+ } else {
53
+ // legacy PHPUnit 4 - PHPUnit 8.4
54
+ return $ this ->getMockBuilder ('stdClass ' )->setMethods (array ('__invoke ' ))->getMock ();
55
+ }
50
56
}
51
57
52
58
protected function expectPromiseResolve ($ promise )
You can’t perform that action at this time.
0 commit comments