|
@@ 35-46 (lines=12) @@
|
| 32 |
|
$this->assertCount(2, $testResultContainer->getFileNames()); |
| 33 |
|
} |
| 34 |
|
|
| 35 |
|
public function testHandleLogItemAddsProcessOutputWhenNeeded() |
| 36 |
|
{ |
| 37 |
|
$testResult = new TestResultWithAbnormalTermination('function name', 'fail message'); |
| 38 |
|
$process = new StubbedParaunitProcess(); |
| 39 |
|
$process->setOutput('test output'); |
| 40 |
|
|
| 41 |
|
$testResultContainer = new TestResultContainer($this->mockTestFormat()); |
| 42 |
|
$testResultContainer->handleTestResult($process, $testResult); |
| 43 |
|
|
| 44 |
|
$this->assertContains('fail message', $testResult->getFailureMessage()); |
| 45 |
|
$this->assertContains('test output', $testResult->getFailureMessage()); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testHandleLogItemAddsMessageWhenProcessOutputIsEmpty() |
| 49 |
|
{ |
|
@@ 48-59 (lines=12) @@
|
| 45 |
|
$this->assertContains('test output', $testResult->getFailureMessage()); |
| 46 |
|
} |
| 47 |
|
|
| 48 |
|
public function testHandleLogItemAddsMessageWhenProcessOutputIsEmpty() |
| 49 |
|
{ |
| 50 |
|
$testResult = new TestResultWithAbnormalTermination('function name', 'fail message'); |
| 51 |
|
$process = new StubbedParaunitProcess(); |
| 52 |
|
$process->setOutput(''); |
| 53 |
|
|
| 54 |
|
$testResultContainer = new TestResultContainer($this->mockTestFormat()); |
| 55 |
|
$testResultContainer->handleTestResult($process, $testResult); |
| 56 |
|
|
| 57 |
|
$this->assertContains('fail message', $testResult->getFailureMessage()); |
| 58 |
|
$this->assertContains('<tag><[NO OUTPUT FOUND]></tag>', $testResult->getFailureMessage()); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
public function testCountTestResultsCountsOnlyResultsWhichProducesSymbols() |
| 62 |
|
{ |
|
@@ 61-74 (lines=14) @@
|
| 58 |
|
$this->assertContains('<tag><[NO OUTPUT FOUND]></tag>', $testResult->getFailureMessage()); |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
public function testCountTestResultsCountsOnlyResultsWhichProducesSymbols() |
| 62 |
|
{ |
| 63 |
|
$testResult = new TestResultWithAbnormalTermination('function name', 'some message'); |
| 64 |
|
$process = new StubbedParaunitProcess(); |
| 65 |
|
$process->setOutput(''); |
| 66 |
|
$testFormat = $this->prophesize(TestResultFormat::class); |
| 67 |
|
$testFormat->getTag() |
| 68 |
|
->willReturn('tag'); |
| 69 |
|
|
| 70 |
|
$testResultContainer = new TestResultContainer($testFormat->reveal()); |
| 71 |
|
$testResultContainer->handleTestResult($process, $testResult); |
| 72 |
|
|
| 73 |
|
$this->assertSame(0, $testResultContainer->countTestResults()); |
| 74 |
|
} |
| 75 |
|
} |
| 76 |
|
|