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