You are here

public function PromiseTest::testForwardsThrownPromisesDownChainBetweenGaps in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testForwardsThrownPromisesDownChainBetweenGaps()

File

vendor/guzzlehttp/promises/tests/PromiseTest.php, line 381

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testForwardsThrownPromisesDownChainBetweenGaps() {
  $e = new \Exception();
  $p = new Promise();
  $r = $r2 = null;
  $p
    ->then(null, null)
    ->then(null, function ($v) use (&$r, $e) {
    $r = $v;
    throw $e;
  })
    ->then(null, function ($v) use (&$r2) {
    $r2 = $v;
  });
  $p
    ->reject('foo');
  P\queue()
    ->run();
  $this
    ->assertEquals('foo', $r);
  $this
    ->assertSame($e, $r2);
}