async-interop / promise-test
An abstract test file to ensure compatibility between promise implementations.
v0.4.1
2017-01-07 12:55 UTC
Requires
- php: >=5.4.0
- async-interop/promise: ^0.4
- phpunit/phpunit: ^4|^5
This package is not auto-updated.
Last update: 2024-10-26 20:32:23 UTC
README
This package provides a quite extensive phpunit test suite to be used against Promise
implementations from the async-interop/promise package.
Usage
class MyDriverTest extends \Interop\Async\Promise\Test { function getFactory() { return new MyDriverFactory; } function getPromise() { $resolver = new MyPromiseResolver; return [ $resolver->promise(), function($v) use ($resolver) { $resolver->succeed($v); }, function($e) use ($resolver) { $resolver->fail($e); }, ]; } }
That's it. Put it in your tests folder with an appropriate phpunit setup and run it.