Download the PHP package matthiasnoback/phpunit-asynchronicity without Composer
On this page you can find all versions of the php package matthiasnoback/phpunit-asynchronicity. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download matthiasnoback/phpunit-asynchronicity
More information about matthiasnoback/phpunit-asynchronicity
Files in matthiasnoback/phpunit-asynchronicity
Download matthiasnoback/phpunit-asynchronicity
More information about matthiasnoback/phpunit-asynchronicity
Files in matthiasnoback/phpunit-asynchronicity
Vendor matthiasnoback
Package phpunit-asynchronicity
Short Description Library for asserting things that happen asynchronously with PHPUnit
License MIT
Package phpunit-asynchronicity
Short Description Library for asserting things that happen asynchronously with PHPUnit
License MIT
Please rate this library. Is it a good library?
Informations about the package phpunit-asynchronicity
Asynchronicity
Using this library you can make a test wait for certain conditions, e.g. to test the output of another process.
See my blog post on the subject for an explanation of the concepts and some code samples. Please note that this article covers version 1 of the library.
Usage
With PHPUnit
With Behat
Within a Behat FeatureContext
you could use it for example that a page eventually contains some text:
Comments and suggestions
- You can use
$this
inside these callables. - You can add
use ($...)
to pass in extra data. - You can throw any type of exception inside the callable to indicate that what you're looking for is not yet the case.
- Often it's convenient to just use the usual assertion methods (PHPUnit or otherwise) inside the callable. They will often provide the right amount of detail in their error messages too.
assertEventually()
supports extra arguments for setting the timeout and wait time in milliseconds.- You can use any callable as the first argument to
assertEventually()
, including objects with an__invoke()
method or something like[$object, 'methodName']
.
All versions of phpunit-asynchronicity with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.1
The package matthiasnoback/phpunit-asynchronicity contains the following files
Loading the files please wait ....