|
@@ 19-30 (lines=12) @@
|
| 16 |
|
/** |
| 17 |
|
* @dataProvider parsableResultsProvider |
| 18 |
|
*/ |
| 19 |
|
public function testParseAndContinue($log, $expectedResult) |
| 20 |
|
{ |
| 21 |
|
$process = new StubbedParaProcess(); |
| 22 |
|
$logLocator = $this->prophesize('Paraunit\Parser\JSONLogFetcher'); |
| 23 |
|
$logLocator->fetch($process)->willReturn(JSONLogStub::cleanLog($log)); |
| 24 |
|
|
| 25 |
|
$parser = new JSONLogParser($logLocator->reveal()); |
| 26 |
|
|
| 27 |
|
$this->assertFalse($parser->parseAndContinue($process)); |
| 28 |
|
|
| 29 |
|
$this->assertEquals($expectedResult, $process->getTestResults()); |
| 30 |
|
} |
| 31 |
|
|
| 32 |
|
public function parsableResultsProvider() |
| 33 |
|
{ |
|
@@ 47-58 (lines=12) @@
|
| 44 |
|
); |
| 45 |
|
} |
| 46 |
|
|
| 47 |
|
public function testLogNotFound() |
| 48 |
|
{ |
| 49 |
|
$process = new StubbedParaProcess(); |
| 50 |
|
$logLocator = $this->prophesize('Paraunit\Parser\JSONLogFetcher'); |
| 51 |
|
$logLocator->fetch($process)->willThrow(new JSONLogNotFoundException($process)); |
| 52 |
|
|
| 53 |
|
$parser = new JSONLogParser($logLocator->reveal()); |
| 54 |
|
|
| 55 |
|
$this->assertTrue($parser->parseAndContinue($process)); |
| 56 |
|
|
| 57 |
|
$this->assertEmpty($process->getTestResults()); |
| 58 |
|
} |
| 59 |
|
} |
| 60 |
|
|