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.
52 lines
1.1 KiB
52 lines
1.1 KiB
<?php |
|
|
|
namespace React\Tests\Socket; |
|
|
|
class TestCase extends \PHPUnit_Framework_TestCase |
|
{ |
|
protected function expectCallableExactly($amount) |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->exactly($amount)) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
protected function expectCallableOnce() |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->once()) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
protected function expectCallableOnceWith($value) |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->once()) |
|
->method('__invoke') |
|
->with($value); |
|
|
|
return $mock; |
|
} |
|
|
|
protected function expectCallableNever() |
|
{ |
|
$mock = $this->createCallableMock(); |
|
$mock |
|
->expects($this->never()) |
|
->method('__invoke'); |
|
|
|
return $mock; |
|
} |
|
|
|
protected function createCallableMock() |
|
{ |
|
return $this->getMock('React\Tests\Socket\Stub\CallableStub'); |
|
} |
|
}
|
|
|