Code Duplication    Length = 12-13 lines in 3 locations

tests/Functional/Parser/JSON/AbnormalTerminatedParserTest.php 1 location

@@ 19-31 (lines=13) @@
16
 */
17
class AbnormalTerminatedParserTest extends BaseFunctionalTestCase
18
{
19
    public function testHandleLogItemWithAbnormalTermination()
20
    {
21
        $process = new StubbedParaunitProcess();
22
        $log = new \stdClass();
23
        $log->status = LogFetcher::LOG_ENDING_STATUS;
24
        $log->test = 'testFunction()';
25
        /** @var AbnormalTerminatedParser $parser */
26
        $parser = $this->getService(AbnormalTerminatedParser::class);
27
28
        $parsedResult = $parser->handleLogItem($process, $log);
29
30
        $this->assertInstanceOf(TestResultWithAbnormalTermination::class, $parsedResult);
31
    }
32
33
    /**
34
     * @dataProvider otherStatusesProvider

tests/Unit/Parser/JSON/TestStartParserTest.php 2 locations

@@ 54-65 (lines=12) @@
51
        ];
52
    }
53
54
    public function testHandleLogItemCatchesEndingIfGraceful()
55
    {
56
        $process = new StubbedParaunitProcess();
57
        $process->setWaitingForTestResult(false);
58
        $parser = new TestStartParser();
59
        $log = new \stdClass();
60
        $log->status = LogFetcher::LOG_ENDING_STATUS;
61
62
        $return = $parser->handleLogItem($process, $log);
63
64
        $this->assertInstanceOf(TestResultInterface::class, $return);
65
    }
66
67
    public function testHandleLogItemAppendsNoCulpableFunctionForMissingLog()
68
    {
@@ 67-79 (lines=13) @@
64
        $this->assertInstanceOf(TestResultInterface::class, $return);
65
    }
66
67
    public function testHandleLogItemAppendsNoCulpableFunctionForMissingLog()
68
    {
69
        $process = new StubbedParaunitProcess();
70
        $process->setWaitingForTestResult(true);
71
        $parser = new TestStartParser();
72
        $log = new \stdClass();
73
        $log->status = LogFetcher::LOG_ENDING_STATUS;
74
75
        $return = $parser->handleLogItem($process, $log);
76
77
        $this->assertNull($return);
78
        $this->assertEquals('UNKNOWN -- log not found', $log->test);
79
    }
80
81
    public function testHandleLogItemAppendsCulpableFunction()
82
    {