Skip to content

Commit

Permalink
Merge pull request #245 from WyriHaximus/ensure-tests-run-in-an-fiber…
Browse files Browse the repository at this point in the history
…-by-getting-current-fiber-and-etsting-it-against-null

Ensure tests run in and fiber by getting current fiber and testing it against !== null
  • Loading branch information
WyriHaximus authored Mar 30, 2024
2 parents b89cd11 + de7c1f3 commit 2cdee4c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tests/AsyncTestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace WyriHaximus\Tests\AsyncTestUtilities;

use Fiber;
use React\EventLoop\Loop;
use WyriHaximus\AsyncTestUtilities\AsyncTestCase;
use WyriHaximus\AsyncTestUtilities\TimeOut;
Expand All @@ -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);
Expand Down

0 comments on commit 2cdee4c

Please sign in to comment.