public function FunctionsTest::testAllThrowsWhenAnyRejected in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::testAllThrowsWhenAnyRejected()
File
- vendor/
guzzlehttp/ promises/ tests/ functionsTest.php, line 106
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testAllThrowsWhenAnyRejected() {
$a = new Promise();
$b = new Promise();
$c = new Promise();
$d = \GuzzleHttp\Promise\all([
$a,
$b,
$c,
]);
$b
->resolve('b');
$a
->reject('fail');
$c
->resolve('c');
$d
->then(function ($value) use (&$result) {
$result = $value;
}, function ($reason) use (&$result) {
$result = $reason;
});
P\queue()
->run();
$this
->assertEquals('fail', $result);
}