File tree Expand file tree Collapse file tree 11 files changed +37
-9
lines changed
Expand file tree Collapse file tree 11 files changed +37
-9
lines changed Original file line number Diff line number Diff line change 44<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
55 xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd"
66 bootstrap =" vendor/autoload.php"
7+ cacheResult =" false"
78 colors =" true"
8- cacheResult = " false " >
9+ convertDeprecationsToExceptions = " true " >
910 <testsuites >
1011 <testsuite name =" React test suite" >
1112 <directory >./tests/</directory >
Original file line number Diff line number Diff line change @@ -12,8 +12,12 @@ abstract class AbstractLoopTest extends TestCase
1212 */
1313 protected $ loop ;
1414
15+ /** @var float */
1516 private $ tickTimeout ;
1617
18+ /** @var ?string */
19+ private $ received ;
20+
1721 const PHP_DEFAULT_CHUNK_SIZE = 8192 ;
1822
1923 /**
Original file line number Diff line number Diff line change 66
77class ExtEventLoopTest extends AbstractLoopTest
88{
9+ /** @var ?string */
10+ private $ fifoPath ;
11+
912 public function createLoop ($ readStreamCompatible = false )
1013 {
1114 if ('Linux ' === PHP_OS && !extension_loaded ('posix ' )) {
@@ -19,12 +22,23 @@ public function createLoop($readStreamCompatible = false)
1922 return new ExtEventLoop ();
2023 }
2124
25+ /**
26+ * @after
27+ */
28+ public function tearDownFile ()
29+ {
30+ if ($ this ->fifoPath !== null && file_exists ($ this ->fifoPath )) {
31+ unlink ($ this ->fifoPath );
32+ }
33+ }
34+
2235 public function createStream ()
2336 {
2437 // Use a FIFO on linux to get around lack of support for disk-based file
2538 // descriptors when using the EPOLL back-end.
2639 if ('Linux ' === PHP_OS ) {
2740 $ this ->fifoPath = tempnam (sys_get_temp_dir (), 'react- ' );
41+ assert (is_string ($ this ->fifoPath ));
2842
2943 unlink ($ this ->fifoPath );
3044
Original file line number Diff line number Diff line change 66
77class ExtLibeventLoopTest extends AbstractLoopTest
88{
9+ /** @var ?string */
910 private $ fifoPath ;
1011
1112 public function createLoop ()
@@ -26,7 +27,7 @@ public function createLoop()
2627 */
2728 public function tearDownFile ()
2829 {
29- if (file_exists ($ this ->fifoPath )) {
30+ if ($ this -> fifoPath !== null && file_exists ($ this ->fifoPath )) {
3031 unlink ($ this ->fifoPath );
3132 }
3233 }
@@ -38,6 +39,7 @@ public function createStream()
3839 }
3940
4041 $ this ->fifoPath = tempnam (sys_get_temp_dir (), 'react- ' );
42+ assert (is_string ($ this ->fifoPath ));
4143
4244 unlink ($ this ->fifoPath );
4345
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78Loop::futureTick (function () {
89 echo 'b ' ;
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78$ loop = Loop::get ();
89
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78$ loop = Loop::get ();
89
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78Loop::addTimer (10.0 , function () {
89 echo 'never ' ;
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78Loop::get ()->addTimer (10.0 , function () {
89 echo 'never ' ;
Original file line number Diff line number Diff line change 22
33use React \EventLoop \Loop ;
44
5- require __DIR__ . '/../../vendor/autoload.php ' ;
5+ // autoload for local project development or project installed as dependency for reactphp/reactphp
6+ (@include __DIR__ . '/../../vendor/autoload.php ' ) || require __DIR__ . '/../../../../autoload.php ' ;
67
78Loop::addTimer (10.0 , function () {
89 echo 'never ' ;
You can’t perform that action at this time.
0 commit comments