Files

42 lines
891 B
PHP
Raw Permalink Normal View History

2026-11-17 16:15:01 -05:00
<?php
namespace React\Tests\EventLoop;
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 expectCallableNever()
{
$mock = $this->createCallableMock();
$mock
->expects($this->never())
->method('__invoke');
return $mock;
}
protected function createCallableMock()
{
return $this->getMockBuilder('React\Tests\EventLoop\CallableStub')->getMock();
}
}