Skip to content

Commit c148594

Browse files
committed
Ensure tests run in and fiber by getting current fiber and testing it against !== null
1 parent 5fc7784 commit c148594

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/RunTestsInFibersTraitTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace WyriHaximus\Tests\React\PHPUnit;
66

7+
use Fiber;
78
use PHPUnit\Framework\TestCase;
89
use React\EventLoop\Loop;
910
use WyriHaximus\React\PHPUnit\RunTestsInFibersTrait;
@@ -35,6 +36,11 @@ public function allTestsAreRanInAFiber(): void
3536
echo 'b';
3637
}
3738

39+
public function testFiberGetCurrentReturnsAFiberInstance(): void
40+
{
41+
self::assertInstanceOf(Fiber::class, Fiber::getCurrent());
42+
}
43+
3844
/** @test */
3945
#[SomeAttribute]
4046
#[TimeOut(0.1)]

0 commit comments

Comments
 (0)