public function PromiseTest::testCreatesPromiseWhenFulfilledBeforeThen in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testCreatesPromiseWhenFulfilledBeforeThen()
File
- vendor/
guzzlehttp/ promises/ tests/ PromiseTest.php, line 282
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testCreatesPromiseWhenFulfilledBeforeThen() {
$p = new Promise();
$p
->resolve('foo');
$carry = null;
$p2 = $p
->then(function ($v) use (&$carry) {
$carry = $v;
});
$this
->assertNotSame($p, $p2);
$this
->assertNull($carry);
\GuzzleHttp\Promise\queue()
->run();
$this
->assertEquals('foo', $carry);
}