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