Completed
Push — output_parsers_refactor ( 755930...b5c5df )
by Alessandro
07:17
created

JSONLogParserTest::testParseHandlesMissingLogs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 12
rs 9.4285
cc 1
eloc 8
nc 1
nop 0
1
<?php
2
3
namespace Paraunit\Tests\Unit\Parser;
4
5
use Paraunit\Exception\JSONLogNotFoundException;
6
use Paraunit\Exception\RecoverableTestErrorException;
7
use Paraunit\Parser\JSONLogParser;
8
use Paraunit\Tests\Stub\PHPUnitOutput\JSONLogs\JSONLogStub;
9
use Paraunit\Tests\Stub\StubbedParaProcess;
10
use Prophecy\Argument;
11
12
/**
13
 * Class JSONLogParserTest
14
 * @package Paraunit\Tests\Unit\Parser
15
 */
16
class JSONLogParserTest extends \PHPUnit_Framework_TestCase
17
{
18
    public function testParseHandlesMissingLogs()
19
    {
20
        $process = new StubbedParaProcess();
21
        $logLocator = $this->prophesize('Paraunit\Parser\JSONLogFetcher');
22
        $logLocator->fetch($process)->willThrow(new JSONLogNotFoundException($process));
23
        $parser = new JSONLogParser($logLocator->reveal());
24
25
        $parser->parse($process);
26
27
        $this->assertTrue($process->hasAbnormalTermination());
28
        $this->assertEquals('Unknown function -- test log not found', $process->getAbnormalTerminatedFunction());
29
    }
30
}
31