public function FunctionsTest::testAnyReturnsFirstMatch in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/guzzlehttp/promises/tests/functionsTest.php \GuzzleHttp\Promise\Tests\FunctionsTest::testAnyReturnsFirstMatch()
File
- vendor/
guzzlehttp/ promises/ tests/ functionsTest.php, line 188
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testAnyReturnsFirstMatch() {
$a = new Promise();
$b = new Promise();
$c = \GuzzleHttp\Promise\any([
$a,
$b,
]);
$b
->resolve('b');
$a
->resolve('a');
//P\queue()->run();
//$this->assertEquals('fulfilled', $c->getState());
$c
->then(function ($value) use (&$result) {
$result = $value;
});
P\queue()
->run();
$this
->assertEquals('b', $result);
}