From de7c1f3b1a1db483d86aa22cf21e9682695bf091 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Sat, 30 Mar 2024 07:51:59 +0100 Subject: [PATCH] Ensure tests run in and fiber by getting current fiber and testing it against !== null --- tests/AsyncTestCaseTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/AsyncTestCaseTest.php b/tests/AsyncTestCaseTest.php index 0e7927b..144b143 100644 --- a/tests/AsyncTestCaseTest.php +++ b/tests/AsyncTestCaseTest.php @@ -4,6 +4,7 @@ namespace WyriHaximus\Tests\AsyncTestUtilities; +use Fiber; use React\EventLoop\Loop; use WyriHaximus\AsyncTestUtilities\AsyncTestCase; use WyriHaximus\AsyncTestUtilities\TimeOut; @@ -29,6 +30,11 @@ public function testAllTestsAreRanInAFiber(): void echo 'b'; } + public function testFiberGetCurrentReturnsAFiberInstance(): void + { + self::assertInstanceOf(Fiber::class, Fiber::getCurrent()); + } + public function testExpectCallableExactly(): void { $callable = $this->expectCallableExactly(3);