Code Duplication    Length = 20-21 lines in 2 locations

src/Paraunit/Tests/Functional/Runner/RunnerTest.php 2 locations

@@ 35-55 (lines=21) @@
32
        $this->assertEquals(3, $greenCount);
33
    }
34
35
    public function testMaxRetryEntityManagerIsClosed()
36
    {
37
        $outputInterface = new ConsoleOutputStub();
38
39
        /** @var Runner $runner */
40
        $runner = $this->container->get('paraunit.runner.runner');
41
42
        $fileArray = array(
43
            'src/Paraunit/Tests/Stub/EntityManagerClosedTestStub.php',
44
        );
45
46
        $this->assertNotEquals(0, $runner->run($fileArray, $outputInterface, new PHPUnitConfigFile('')));
47
48
        $retryCount = array();
49
        preg_match_all('/<ok>A<\/ok>/', $outputInterface->getOutput(), $retryCount);
50
        $errorCount = array();
51
        preg_match_all('/<error>X|E<\/error>/', $outputInterface->getOutput(), $errorCount);
52
53
        $this->assertCount($this->container->getParameter('paraunit.max_retry_count'), $retryCount[0]);
54
        $this->assertCount(1, $errorCount[0]);
55
    }
56
57
    /**
58
     * @dataProvider stubFilePathProvider
@@ 60-79 (lines=20) @@
57
    /**
58
     * @dataProvider stubFilePathProvider
59
     */
60
    public function testMaxRetryDeadlock($stubFilePath)
61
    {
62
        $outputInterface = new ConsoleOutputStub();
63
64
        $runner = $this->container->get('paraunit.runner.runner');
65
66
        $fileArray = array(
67
            $stubFilePath,
68
        );
69
70
        $this->assertNotEquals(0, $runner->run($fileArray, $outputInterface, new PHPUnitConfigFile('')));
71
72
        $retryCount = array();
73
        preg_match_all('/<ok>A<\/ok>/', $outputInterface->getOutput(), $retryCount);
74
        $errorCount = array();
75
        preg_match_all('/<error>X|E<\/error>/', $outputInterface->getOutput(), $errorCount);
76
77
        $this->assertCount($this->container->getParameter('paraunit.max_retry_count'), $retryCount[0]);
78
        $this->assertCount(1, $errorCount[0]);
79
    }
80
81
    public function stubFilePathProvider()
82
    {