| 1 | <?php |
||
| 10 | abstract class BaseUnitTestCase extends \PHPUnit_Framework_TestCase |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @param $testOutput |
||
| 14 | * @return \stdClass |
||
| 15 | */ |
||
| 16 | protected function getLogWithStatus($status, $testOutput = null) |
||
| 17 | { |
||
| 18 | $jsonLogs = JSONLogStub::getCleanOutputFileContent(JSONLogStub::ONE_ERROR); |
||
| 19 | $logs = json_decode($jsonLogs); |
||
| 20 | foreach ($logs as $log) { |
||
| 21 | if ($log->event == 'test' && $log->status == $status) { |
||
| 22 | if ($testOutput) { |
||
| 23 | $log->message = $testOutput; |
||
| 24 | } |
||
| 25 | |||
| 26 | return $log; |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | $this->fail('Feasible log message not found for test'); |
||
| 31 | } |
||
| 32 | } |
||
| 33 |