File tree Expand file tree Collapse file tree 8 files changed +46
-9
lines changed
Expand file tree Collapse file tree 8 files changed +46
-9
lines changed Original file line number Diff line number Diff line change 33/.gitignore export-ignore
44/examples / export-ignore
55/phpunit.xml.dist export-ignore
6+ /phpunit.xml.legacy export-ignore
67/tests / export-ignore
Original file line number Diff line number Diff line change 1111 strategy :
1212 matrix :
1313 php :
14+ - 8.0
1415 - 7.4
1516 - 7.3
1617 - 7.2
2829 coverage : xdebug
2930 - run : composer install
3031 - 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 }}
3135
3236 PHPUnit-hhvm :
3337 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
240240See also the [ CHANGELOG] ( CHANGELOG.md ) for details about version upgrades.
241241
242242This 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
244244HHVM.
245245It's * highly recommended to use PHP 7+* for this project.
246246
Original file line number Diff line number Diff line change 1717 "rize/uri-template" : " ^0.3"
1818 },
1919 "require-dev" : {
20- "phpunit/phpunit" : " ^7.0 || ^6.0 || ^5.7 || ^4.8.35"
20+ "phpunit/phpunit" : " ^9.3 || ^5.7 || ^4.8.35"
2121 },
2222 "autoload" : {
2323 "psr-4" : { "Clue\\ React\\ Packagist\\ Api\\ " : " src/" }
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22
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" >
49 <testsuites >
510 <testsuite name =" Packagist React Test Suite" >
611 <directory >./tests/</directory >
712 </testsuite >
813 </testsuites >
9- <filter >
10- <whitelist >
14+ <coverage >
15+ <include >
1116 <directory >./src/</directory >
12- </whitelist >
13- </filter >
17+ </include >
18+ </coverage >
1419</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
1212 private $ browser ;
1313 private $ client ;
1414
15- public function setUp ()
15+ /**
16+ * @before
17+ */
18+ public function setUpClient ()
1619 {
1720 $ this ->browser = $ this ->getMockBuilder ('Clue\React\Buzz\Browser ' )->disableOriginalConstructor ()->getMock ();
1821 $ 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)
4646
4747 protected function createCallableMock ()
4848 {
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+ }
5056 }
5157
5258 protected function expectPromiseResolve ($ promise )
You can’t perform that action at this time.
0 commit comments