| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function apply($code, MockConfiguration $config) |
||
| 30 | { |
||
| 31 | $names = array_map(function ($method) { |
||
| 32 | return $method->getName(); |
||
| 33 | }, $config->getMethodsToMock()); |
||
| 34 | |||
| 35 | foreach (["allows", "expects"] as $method) { |
||
| 36 | if (in_array($method, $names)) { |
||
| 37 | $code = preg_replace( |
||
| 38 | "#// start method {$method}.*// end method {$method}#ms", |
||
| 39 | "", |
||
| 40 | $code |
||
| 41 | ); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $code; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |