Total Complexity | 4 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
16 | class ObjectExceptionMatcher extends Matcher { |
||
17 | public function withMessage($message) { |
||
18 | $this->startStep('has message "' . $message . '"')->expectExceptionMessage($message); |
||
19 | return $this; |
||
20 | } |
||
21 | |||
22 | public function withMessageMatchesPattern($messagePattern) { |
||
26 | } |
||
27 | |||
28 | public function withCode($code) { |
||
29 | $this->startStep('has code "' . $code . '"')->expectExceptionCode($code); |
||
30 | return $this; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Identifies a situation when exception should be raised. |
||
35 | * Supposed to executes method of the object. |
||
36 | * This methods should to be used after {@link throwsException} and "with*" methods to gain expression like: |
||
37 | * <pre> |
||
38 | * $I->seeObject($a)->throwsException(Exception::class)->when(function($object) {$object->doParty();}); |
||
39 | * // or |
||
40 | * $I->seeObject($a)->throwsException(IronyException::class)->withCode(500)->when(function($object) {$object->doParty();}); |
||
41 | * <pre/> |
||
42 | * and finish scenario. |
||
43 | */ |
||
44 | public function when(callable $callback) { |
||
46 | } |
||
47 | } |