amphp/phpunit-util

Helper package to ease testing with PHPUnit.

v1.0.0 2017-06-15 15:43 UTC

README

License

amphp/phpunit-util is a small helper package to ease testing with PHPUnit in combination with the amp concurrency framework.

Required PHP Version

  • PHP 7.0+

Installation

composer require --dev amphp/phpunit-util

Usage

Currently, this package only provides a PHPUnit TestListener to reset the global event loop after each test. By adding the listener to your PHPUnit configuration, each test will be executed with a completely new event loop instance.

<phpunit>
    <!-- ... -->

    <listeners>
        <listener class="Amp\PHPUnit\LoopReset" />
    </listeners>

    <!-- ... -->
</phpunit>