You are here

public function PromiseTest::testForwardsFulfilledDownChainBetweenGaps in Zircon Profile 8

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

File

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

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testForwardsFulfilledDownChainBetweenGaps() {
  $p = new Promise();
  $r = $r2 = null;
  $p
    ->then(null, null)
    ->then(function ($v) use (&$r) {
    $r = $v;
    return $v . '2';
  })
    ->then(function ($v) use (&$r2) {
    $r2 = $v;
  });
  $p
    ->resolve('foo');
  P\queue()
    ->run();
  $this
    ->assertEquals('foo', $r);
  $this
    ->assertEquals('foo2', $r2);
}