mirror of
https://github.com/danog/endtoend-test-psl.git
synced 2024-12-12 09:09:45 +01:00
41 lines
948 B
PHP
41 lines
948 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Psl\Tests\Asio;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
use Psl\Asio\WrappedResult;
|
|
use Psl\Exception\InvariantViolationException;
|
|
|
|
class WrappedResultTest extends TestCase
|
|
{
|
|
public function testIsSucceeded(): void
|
|
{
|
|
$wrapper = new WrappedResult('hello');
|
|
self::assertTrue($wrapper->isSucceeded());
|
|
}
|
|
|
|
public function testIsFailed(): void
|
|
{
|
|
$wrapper = new WrappedResult('hello');
|
|
self::assertFalse($wrapper->isFailed());
|
|
}
|
|
|
|
public function testGetResult(): void
|
|
{
|
|
$wrapper = new WrappedResult('hello');
|
|
self::assertSame('hello', $wrapper->getResult());
|
|
}
|
|
|
|
public function testGetException(): void
|
|
{
|
|
$wrapper = new WrappedResult('hello');
|
|
|
|
$this->expectException(InvariantViolationException::class);
|
|
$this->expectExceptionMessage('No exception thrown');
|
|
|
|
$wrapper->getException();
|
|
}
|
|
}
|