public function EachPromiseTest::testRejectsAggregateWhenNextThrows in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/EachPromiseTest.php \GuzzleHttp\Promise\Tests\EachPromiseTest::testRejectsAggregateWhenNextThrows()
File
- vendor/
guzzlehttp/ promises/ tests/ EachPromiseTest.php, line 220
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testRejectsAggregateWhenNextThrows() {
$iter = function () {
(yield 'a');
throw new \Exception('Failure');
};
$each = new EachPromise($iter());
$p = $each
->promise();
$e = null;
$received = null;
$p
->then(null, function ($reason) use (&$e) {
$e = $reason;
});
P\queue()
->run();
$this
->assertInstanceOf('Exception', $e);
$this
->assertEquals('Failure', $e
->getMessage());
}