You are here

public function PromiseTest::testInvokesWaitFnsForThens in Zircon Profile 8.0

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

File

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

Class

PromiseTest
@covers GuzzleHttp\Promise\Promise

Namespace

GuzzleHttp\Promise\Tests

Code

public function testInvokesWaitFnsForThens() {
  $p = new Promise(function () use (&$p) {
    $p
      ->resolve('a');
  });
  $p2 = $p
    ->then(function ($v) {
    return $v . '-1-';
  })
    ->then(function ($v) {
    return $v . '2';
  });
  $this
    ->assertEquals('a-1-2', $p2
    ->wait());
}