1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00
Go to file
2017-01-07 11:47:58 +01:00
src Change namespace to AsyncInterop 2017-01-07 11:47:58 +01:00
.gitignore Initial commit 2016-10-24 19:53:21 +02:00
composer.json Change namespace to AsyncInterop 2017-01-07 11:47:58 +01:00
LICENSE Initial commit 2016-10-24 19:53:21 +02:00
README.md Update to Promise 2016-12-23 13:14:11 +01:00

Promise Tests

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.