You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
895 B
43 lines
895 B
<?php |
|
|
|
namespace React\Promise; |
|
|
|
class TestCase extends \PHPUnit_Framework_TestCase |
|
{ |
|
public function expectCallableExactly($amount) |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->exactly($amount)) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
public function expectCallableOnce() |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->once()) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
public function expectCallableNever() |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->never()) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
public function createCallableMock() |
|
{ |
|
return $this |
|
->getMockBuilder('React\\Promise\Stub\CallableStub') |
|
->getMock(); |
|
} |
|
}
|
|
|