Conditions | 5 |
Paths | 4 |
Total Lines | 19 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 5 |
Changes | 0 |
1 | <?php |
||
16 | 41 | public function createFromLog(\stdClass $log): PrintableTestResultInterface |
|
17 | { |
||
18 | 41 | if (property_exists($log, 'status') && $log->status === LogFetcher::LOG_ENDING_STATUS) { |
|
19 | 13 | return new TestResultWithAbnormalTermination( |
|
20 | 13 | $log->test, |
|
21 | 13 | 'Abnormal termination -- complete test output:' |
|
22 | ); |
||
23 | } |
||
24 | |||
25 | 35 | if (! property_exists($log, 'message')) { |
|
26 | 5 | return new MuteTestResult(); |
|
27 | } |
||
28 | |||
29 | 32 | if (property_exists($log, 'trace')) { |
|
30 | 31 | return new FullTestResult($log->test, $log->message, $log->trace); |
|
31 | } |
||
32 | |||
33 | 1 | return new TestResultWithMessage($log->test, $log->message); |
|
34 | } |
||
35 | } |
||
36 |