init
This commit is contained in:
64
vendor/react/promise/tests/FunctionRejectTest.php
vendored
Executable file
64
vendor/react/promise/tests/FunctionRejectTest.php
vendored
Executable file
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
namespace React\Promise;
|
||||
|
||||
class FunctionRejectTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function shouldRejectAnImmediateValue()
|
||||
{
|
||||
$expected = 123;
|
||||
|
||||
$mock = $this->createCallableMock();
|
||||
$mock
|
||||
->expects($this->once())
|
||||
->method('__invoke')
|
||||
->with($this->identicalTo($expected));
|
||||
|
||||
reject($expected)
|
||||
->then(
|
||||
$this->expectCallableNever(),
|
||||
$mock
|
||||
);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function shouldRejectAFulfilledPromise()
|
||||
{
|
||||
$expected = 123;
|
||||
|
||||
$resolved = new FulfilledPromise($expected);
|
||||
|
||||
$mock = $this->createCallableMock();
|
||||
$mock
|
||||
->expects($this->once())
|
||||
->method('__invoke')
|
||||
->with($this->identicalTo($expected));
|
||||
|
||||
reject($resolved)
|
||||
->then(
|
||||
$this->expectCallableNever(),
|
||||
$mock
|
||||
);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function shouldRejectARejectedPromise()
|
||||
{
|
||||
$expected = 123;
|
||||
|
||||
$resolved = new RejectedPromise($expected);
|
||||
|
||||
$mock = $this->createCallableMock();
|
||||
$mock
|
||||
->expects($this->once())
|
||||
->method('__invoke')
|
||||
->with($this->identicalTo($expected));
|
||||
|
||||
reject($resolved)
|
||||
->then(
|
||||
$this->expectCallableNever(),
|
||||
$mock
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user