7.0.0
This release drops all deprecated await
methods. Use the await
and other related functions directly.
Major new feature in this release:
Since all tests are executed inside a fiber, there is a default timeout of 30
seconds. To lower or raise that timeout
this package comes with a TimeOut
attribute. It can be set on the class and method level. When set on both the method level it takes priority over the class level.
<?php
declare(strict_types=1);
namespace WyriHaximus\Tests\AsyncTestUtilities;
use React�ventLoop\Loop;
use WyriHaximus\AsyncTestUtilities\AsyncTestCase;
use WyriHaximus\AsyncTestUtilities\TimeOut;
use function React\Async�sync;
use function React\Async�wait;
use function React\Promise
esolve;
use function React\Promise\Timer\sleep;
use function time;
#[TimeOut(0.3)]
final class AsyncTestCaseTest extends AsyncTestCase
{
#[TimeOut(1)]
public function testAllTestsAreRanInAFiber(): void
{
self::expectOutputString('ab');
Loop::futureTick(async(static function (): void {
echo 'a';
}));
await(sleep(1));
echo 'b';
}
public function testExpectCallableExactly(): void
{
$callable = $this->expectCallableExactly(3);
Loop::futureTick($callable);
Loop::futureTick($callable);
Loop::futureTick($callable);
}
public function testExpectCallableOnce(): void
{
Loop::futureTick($this->expectCallableOnce());
}
}
7.0.0
- Total issues resolved: 0
- Total pull requests resolved: 4
- Total contributors: 1
Deprecations 👋,NEON 🦹♂️,PHP 🐘,Source 🔮
Configuration ⚙,YAML 🍄
- 196: Add Deprecations Label thanks to @WyriHaximus
Deprecations 👋,NEON 🦹♂️,PHP 🐘,Source 🔮,Tests 🧪
Dependencies 📦,Documentation 📚,Enhancement ✨,Feature 🏗,JSON 👨💼,MarkDown 📝,NEON 🦹♂️,PHP 🐘,Source 🔮,Tests 🧪
- 194: Run all tests in a fiber thanks to @WyriHaximus