1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
<?php
namespace React\Promise;
use Exception;
use PHPUnit\Framework\Attributes\RequiresPhpunit;
use PHPUnit\Framework\Attributes\Test;
class FunctionRejectTest extends TestCase
{
#[Test]
#[RequiresPhpunit('< 12')]
public function shouldRejectAnException(): void
{
$exception = new Exception();
$mock = $this->createCallableMock();
$mock
->expects(self::once())
->method('__invoke')
->with(self::identicalTo($exception));
reject($exception)
->then($this->expectCallableNever(), $mock);
}
}
|