Releases: WyriHaximus/reactphp-phpunit-run-tests-in-fiber
Releases · WyriHaximus/reactphp-phpunit-run-tests-in-fiber
3.0.0
3.0.0
- Total issues resolved: 0
- Total pull requests resolved: 5
- Total contributors: 3
Dependencies 📦,Enhancement ✨
- 19: Update to latest stable makefiles and test utils thanks to @WyriHaximus
- 17: Switch to centralized Makefiles thanks to @WyriHaximus
Dependencies 📦
- 18: Update dependency wyrihaximus/makefiles to ^0.1.0 || ^0.2.0 thanks to @renovate[bot]
- 16: Bump composer/composer from 2.7.2 to 2.7.7 thanks to @dependabot[bot]
- 15: Update dependency phpunit/phpunit to v12 thanks to @renovate[bot]
2.0.0
- PHP8.2+
- PHPUnit 10+ + added it as a dependency to enforce supported versions
2.0.0
- Total issues resolved: 0
- Total pull requests resolved: 7
- Total contributors: 2
Bug 🐞
Dependencies 📦,Enhancement ✨
- 14: Add phpunit/phpunit as dependency to lock down supported versions thanks to @WyriHaximus
- 11: Drop promise v2 support thanks to @WyriHaximus
- 8: Bump to PHP 8.2+ thanks to @WyriHaximus
Dependencies 📦
- 13: Update dependency wyrihaximus/test-utilities to v6 thanks to @renovate[bot]
Enhancement ✨
1.0.1
1.0.1
- Total issues resolved: 0
- Total pull requests resolved: 1
- Total contributors: 1
Bug 🐞,Dependencies 📦
1.0.0
Usage
<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use React\Promise\Promise;
use WyriHaximus\React\PHPUnit\RunTestsInFibersTrait;
use function React\Async�wait;
final class SomeTest extends TestCase
{
use RunTestsInFibersTrait;
/**
* @test
*/
public function happyFlow()
{
self::assertTrue(await(new Promise(static function (callable $resolve): void {
$resolve(true);
})));
}
}
Timeouts
This package supports marking a test failed once a timeout has been reached. Note that this doesn't stop anything
running in the fiber the rest runs in or cleans up the loop as we cannot kill the running fiber once it starts. An
exception is thrown in the scope between the test and PHPUnit that handles running the test in a fiber. And this is out
of control of the test.
<?php
declare(strict_types=1);
use PHPUnit\Framework\TestCase;
use React\Promise\Promise;
use WyriHaximus\React\PHPUnit\RunTestsInFibersTrait;
use WyriHaximus\React\PHPUnit\TimeOut;
use function React\Async�wait;
#[TimeOut(30)]
final class SomeTest extends TestCase
{
use RunTestsInFibersTrait;
/**
* @test
*/
#[TimeOut(0.1)]
public function happyFlow()
{
self::assertTrue(await(new Promise(static function (callable $resolve): void {
$resolve(true);
})));
}
}
1.0.0
- Total issues resolved: 0
- Total pull requests resolved: 5
- Total contributors: 2
Bug 🐞,Dependencies 📦
- 3: Set up package thanks to @WyriHaximus
Dependencies 📦
- 5: Bump composer/composer from 2.6.6 to 2.7.0 thanks to @dependabot[bot]
Feature 🏗
- 6: Enforce timeouts thanks to @WyriHaximus
- 1: Set up package thanks to @WyriHaximus
Enhancement ✨
- 4: Add documentation thanks to @WyriHaximus