$deferred->complete(1)); self::assertSame([1, 2], all([$deferred->getFuture(), Future::complete(2)])); } public function testTwoFirstThrowing(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('foo'); all([Future::error(new \Exception('foo')), Future::complete(2)]); } public function testTwoGeneratorThrows(): void { $this->expectException(\Exception::class); $this->expectExceptionMessage('foo'); all((static function () { yield Future::error(new \Exception('foo')); yield Future::complete(2); })()); } }