assertFalse($wrapper->isSucceeded()); $this->assertTrue($wrapper->isFailed()); $this->assertSame($exception, $wrapper->getException()); $this->expectExceptionObject($exception); $wrapper->getResult(); } public function testWrapResult(): void { $wrapper = Asio\wrap(static function(): string { return 'foo'; }); $this->assertTrue($wrapper->isSucceeded()); $this->assertFalse($wrapper->isFailed()); $this->assertSame('foo', $wrapper->getResult()); $this->expectException(InvariantViolationException::class); $this->expectExceptionMessage('No exception thrown'); $wrapper->getException(); } }