public function EachPromiseTest::testClearsReferencesWhenResolved in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/guzzlehttp/promises/tests/EachPromiseTest.php \GuzzleHttp\Promise\Tests\EachPromiseTest::testClearsReferencesWhenResolved()
File
- vendor/
guzzlehttp/ promises/ tests/ EachPromiseTest.php, line 137
Class
Namespace
GuzzleHttp\Promise\TestsCode
public function testClearsReferencesWhenResolved() {
$called = false;
$a = new Promise(function () use (&$a, &$called) {
$a
->resolve('a');
$called = true;
});
$each = new EachPromise([
$a,
], [
'concurrency' => function () {
return 1;
},
'fulfilled' => function () {
},
'rejected' => function () {
},
]);
$each
->promise()
->wait();
$this
->assertNull($this
->readAttribute($each, 'onFulfilled'));
$this
->assertNull($this
->readAttribute($each, 'onRejected'));
$this
->assertNull($this
->readAttribute($each, 'iterable'));
$this
->assertNull($this
->readAttribute($each, 'pending'));
$this
->assertNull($this
->readAttribute($each, 'concurrency'));
$this
->assertTrue($called);
}