1
0
mirror of https://github.com/danog/amp.git synced 2024-12-02 17:37:50 +01:00
amp/test/FailureTest.php
Niklas Keller 2f778fe069 Use revolt
Removes deprecated APIs.
2021-03-26 22:34:32 +01:00

27 lines
492 B
PHP

<?php
namespace Amp\Test;
use Amp\Failure;
use Amp\PHPUnit\AsyncTestCase;
use function Amp\await;
class FailureTest extends AsyncTestCase
{
public function testOnResolve(): void
{
$exception = new \Exception;
$failure = new Failure($exception);
try {
await($failure);
} catch (\Exception $reason) {
self::assertSame($exception, $reason);
return;
}
self::fail("Promise was not failed");
}
}