Skip to content

Commit ae621e4

Browse files
committed
Improve bin tests to support running from dependency
1 parent 9f10e11 commit ae621e4

File tree

7 files changed

+14
-7
lines changed

7 files changed

+14
-7
lines changed

tests/bin/01-ticks-loop-class.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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::futureTick(function () {
89
echo 'b';

tests/bin/02-ticks-loop-instance.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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

tests/bin/03-ticks-loop-stop.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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

tests/bin/11-uncaught.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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::addTimer(10.0, function () {
89
echo 'never';

tests/bin/12-undefined.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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::get()->addTimer(10.0, function () {
89
echo 'never';

tests/bin/21-stop.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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::addTimer(10.0, function () {
89
echo 'never';

tests/bin/22-stop-uncaught.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
use 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::addTimer(10.0, function () {
89
echo 'never';

0 commit comments

Comments
 (0)