public function FunctionsTest::testYieldsFromCoroutine in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::testYieldsFromCoroutine()
File
- vendor/
guzzlehttp/ promises/ tests/ functionsTest.php, line 333
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testYieldsFromCoroutine() {
$promise = P\coroutine(function () {
$value = (yield new P\FulfilledPromise('a'));
(yield $value . 'b');
});
$promise
->then(function ($value) use (&$result) {
$result = $value;
});
P\queue()
->run();
$this
->assertEquals('ab', $result);
}