1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?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();
- }
- }
|