public function EachPromiseTest::testReturnsPromiseForWhatever in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/EachPromiseTest.php \GuzzleHttp\Promise\Tests\EachPromiseTest::testReturnsPromiseForWhatever()
File
- vendor/
guzzlehttp/ promises/ tests/ EachPromiseTest.php, line 208
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testReturnsPromiseForWhatever() {
$called = [];
$arr = [
'a',
'b',
];
$each = new EachPromise($arr, [
'fulfilled' => function ($v) use (&$called) {
$called[] = $v;
},
]);
$p = $each
->promise();
$this
->assertNull($p
->wait());
$this
->assertEquals([
'a',
'b',
], $called);
}