public function PromiseTest::testStacksThenWaitFunctions in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/PromiseTest.php \GuzzleHttp\Promise\Tests\PromiseTest::testStacksThenWaitFunctions()
File
- vendor/
guzzlehttp/ promises/ tests/ PromiseTest.php, line 344
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testStacksThenWaitFunctions() {
$p1 = new Promise(function () use (&$p1) {
$p1
->resolve('a');
});
$p2 = new Promise(function () use (&$p2) {
$p2
->resolve('b');
});
$p3 = new Promise(function () use (&$p3) {
$p3
->resolve('c');
});
$p4 = $p1
->then(function () use ($p2) {
return $p2;
})
->then(function () use ($p3) {
return $p3;
});
$this
->assertEquals('c', $p4
->wait());
}