You are here

public function FunctionsTest::testReturnsPromiseForThennable in Zircon Profile 8

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

File

vendor/guzzlehttp/promises/tests/functionsTest.php, line 23

Class

FunctionsTest

Namespace

GuzzleHttp\Promise\Tests

Code

public function testReturnsPromiseForThennable() {
  $p = new Thennable();
  $wrapped = \GuzzleHttp\Promise\promise_for($p);
  $this
    ->assertNotSame($p, $wrapped);
  $this
    ->assertInstanceOf('GuzzleHttp\\Promise\\PromiseInterface', $wrapped);
  $p
    ->resolve('foo');
  P\queue()
    ->run();
  $this
    ->assertEquals('foo', $wrapped
    ->wait());
}