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 4
4
<phpunit xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
5
5
xsi : noNamespaceSchemaLocation =" https://schema.phpunit.de/9.3/phpunit.xsd"
6
6
bootstrap =" vendor/autoload.php"
7
+ cacheResult =" false"
7
8
colors =" true"
8
- cacheResult = " false " >
9
+ convertDeprecationsToExceptions = " true " >
9
10
<testsuites >
10
11
<testsuite name =" React test suite" >
11
12
<directory >./tests/</directory >
Original file line number Diff line number Diff line change @@ -12,8 +12,12 @@ abstract class AbstractLoopTest extends TestCase
12
12
*/
13
13
protected $ loop ;
14
14
15
+ /** @var float */
15
16
private $ tickTimeout ;
16
17
18
+ /** @var ?string */
19
+ private $ received ;
20
+
17
21
const PHP_DEFAULT_CHUNK_SIZE = 8192 ;
18
22
19
23
/**
Original file line number Diff line number Diff line change 6
6
7
7
class ExtEventLoopTest extends AbstractLoopTest
8
8
{
9
+ /** @var ?string */
10
+ private $ fifoPath ;
11
+
9
12
public function createLoop ($ readStreamCompatible = false )
10
13
{
11
14
if ('Linux ' === PHP_OS && !extension_loaded ('posix ' )) {
@@ -19,12 +22,23 @@ public function createLoop($readStreamCompatible = false)
19
22
return new ExtEventLoop ();
20
23
}
21
24
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
+
22
35
public function createStream ()
23
36
{
24
37
// Use a FIFO on linux to get around lack of support for disk-based file
25
38
// descriptors when using the EPOLL back-end.
26
39
if ('Linux ' === PHP_OS ) {
27
40
$ this ->fifoPath = tempnam (sys_get_temp_dir (), 'react- ' );
41
+ assert (is_string ($ this ->fifoPath ));
28
42
29
43
unlink ($ this ->fifoPath );
30
44
Original file line number Diff line number Diff line change 6
6
7
7
class ExtLibeventLoopTest extends AbstractLoopTest
8
8
{
9
+ /** @var ?string */
9
10
private $ fifoPath ;
10
11
11
12
public function createLoop ()
@@ -26,7 +27,7 @@ public function createLoop()
26
27
*/
27
28
public function tearDownFile ()
28
29
{
29
- if (file_exists ($ this ->fifoPath )) {
30
+ if ($ this -> fifoPath !== null && file_exists ($ this ->fifoPath )) {
30
31
unlink ($ this ->fifoPath );
31
32
}
32
33
}
@@ -38,6 +39,7 @@ public function createStream()
38
39
}
39
40
40
41
$ this ->fifoPath = tempnam (sys_get_temp_dir (), 'react- ' );
42
+ assert (is_string ($ this ->fifoPath ));
41
43
42
44
unlink ($ this ->fifoPath );
43
45
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
Loop::futureTick (function () {
8
9
echo 'b ' ;
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
$ loop = Loop::get ();
8
9
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
$ loop = Loop::get ();
8
9
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
Loop::addTimer (10.0 , function () {
8
9
echo 'never ' ;
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
Loop::get ()->addTimer (10.0 , function () {
8
9
echo 'never ' ;
Original file line number Diff line number Diff line change 2
2
3
3
use React \EventLoop \Loop ;
4
4
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 ' ;
6
7
7
8
Loop::addTimer (10.0 , function () {
8
9
echo 'never ' ;
You can’t perform that action at this time.
0 commit comments