Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 16 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
33 | 6 | public function validate($n) |
|
34 | { |
||
35 | 6 | if ($this->_limit < $n) { |
|
36 | 2 | $exception = new Mockery\Exception\InvalidCountException( |
|
37 | 2 | 'Method ' . (string) $this->_expectation |
|
38 | 2 | . ' from ' . $this->_expectation->getMock()->mockery_getName() |
|
39 | 2 | . ' should be called' . PHP_EOL |
|
40 | 2 | . ' at most ' . $this->_limit . ' times but called ' . $n |
|
41 | 2 | . ' times.' |
|
42 | 2 | ); |
|
43 | 2 | $exception->setMock($this->_expectation->getMock()) |
|
44 | 2 | ->setMethodName((string) $this->_expectation) |
|
45 | 2 | ->setExpectedCountComparative('<=') |
|
46 | 2 | ->setExpectedCount($this->_limit) |
|
47 | 2 | ->setActualCount($n); |
|
48 | 2 | throw $exception; |
|
49 | } |
||
50 | 4 | } |
|
51 | } |
||
52 |