Subversion Repositories php-qbpwcf

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3 liveuser 1
<?php
2
 
3
namespace React\Tests\Stream;
4
 
5
class TestCase extends \PHPUnit_Framework_TestCase
6
{
7
    protected function expectCallableExactly($amount)
8
    {
9
        $mock = $this->createCallableMock();
10
        $mock
11
            ->expects($this->exactly($amount))
12
            ->method('__invoke');
13
 
14
        return $mock;
15
    }
16
 
17
    protected function expectCallableOnce()
18
    {
19
        $mock = $this->createCallableMock();
20
        $mock
21
            ->expects($this->once())
22
            ->method('__invoke');
23
 
24
        return $mock;
25
    }
26
 
27
    protected function expectCallableNever()
28
    {
29
        $mock = $this->createCallableMock();
30
        $mock
31
            ->expects($this->never())
32
            ->method('__invoke');
33
 
34
        return $mock;
35
    }
36
 
37
    protected function createCallableMock()
38
    {
39
        return $this->getMock('React\Tests\Stream\CallableStub');
40
    }
41
}