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

JSONLogParserTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 5

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 1
c 6
b 0
f 0
lcom 1
cbo 5
dl 0
loc 15
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A testParseHandlesMissingLogs() 0 12 1
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