| Conditions | 1 |
| Paths | 1 |
| Total Lines | 35 |
| Code Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 53 | public function testApply() |
||
| 54 | { |
||
| 55 | $this |
||
| 56 | ->given($method = $this->newTestedInstance('name')) |
||
| 57 | ->then() |
||
| 58 | ->string($method->apply($method)) |
||
| 59 | ->isEqualTo('name') |
||
| 60 | ; |
||
| 61 | |||
| 62 | $this |
||
| 63 | ->given($method = $this->newTestedInstance('methodWithArgs')) |
||
| 64 | ->then() |
||
| 65 | ->integer($method->with(1, 2)->apply($this)) |
||
| 66 | ->isEqualTo(3) |
||
| 67 | ; |
||
| 68 | |||
| 69 | $this |
||
| 70 | ->given($method = $this->newTestedInstance('foo')) |
||
| 71 | ->then() |
||
| 72 | ->exception(function () use ($method) { |
||
| 73 | $method->apply(null); |
||
| 74 | })->isInstanceOf(\RuntimeException::class) |
||
| 75 | ->exception(function () use ($method) { |
||
| 76 | $method->apply($this); |
||
| 77 | })->isInstanceOf(\RuntimeException::class) |
||
| 78 | ; |
||
| 79 | |||
| 80 | $this |
||
| 81 | ->given($method = $this->newTestedInstance('privateMethod')) |
||
| 82 | ->then() |
||
| 83 | ->exception(function () use ($method) { |
||
| 84 | $method->apply($this); |
||
| 85 | })->isInstanceOf(\RuntimeException::class) |
||
| 86 | ; |
||
| 87 | } |
||
| 88 | } |
||
| 89 |