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