You are here

public function PromiseTest::testWaitBehaviorIsBasedOnLastPromiseInChain in Zircon Profile 8

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

File

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

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testWaitBehaviorIsBasedOnLastPromiseInChain() {
  $p3 = new Promise(function () use (&$p3) {
    $p3
      ->resolve('Whoop');
  });
  $p2 = new Promise(function () use (&$p2, $p3) {
    $p2
      ->reject($p3);
  });
  $p = new Promise(function () use (&$p, $p2) {
    $p
      ->reject($p2);
  });
  $this
    ->assertEquals('Whoop', $p
    ->wait());
}