Skip to content

Commit

Permalink
src/ResultPrinter/HTML.php: Unique Test Signatures (#10)
Browse files Browse the repository at this point in the history
- add fix for #4 to branch 6.0
  • Loading branch information
Tenzian authored and DavertMik committed Mar 12, 2018
1 parent 7481881 commit b3b1c71
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ResultPrinter/HTML.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
);

$failures = '';
$name = Descriptor::getTestSignature($test);
$name = Descriptor::getTestSignatureUnique($test);
if (isset($this->failures[$name])) {
$failTemplate = new \Text_Template(
$this->templatePath . 'fail.html'
Expand Down Expand Up @@ -236,7 +236,7 @@ protected function endRun()
*/
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
{
$this->failures[Descriptor::getTestSignature($test)][] = $this->cleanMessage($e);
$this->failures[Descriptor::getTestSignatureUnique($test)][] = $this->cleanMessage($e);
parent::addError($test, $e, $time);
}

Expand All @@ -249,18 +249,18 @@ public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
*/
public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time)
{
$this->failures[Descriptor::getTestSignature($test)][] = $this->cleanMessage($e);
$this->failures[Descriptor::getTestSignatureUnique($test)][] = $this->cleanMessage($e);
parent::addFailure($test, $e, $time);
}

/**
* Starts test.
*
* @param \PHPUnit\Framework\Test $test
*/
public function startTest(\PHPUnit\Framework\Test $test)
{
$name = Descriptor::getTestSignature($test);
$name = Descriptor::getTestSignatureUnique($test);
if (isset($this->failures[$name])) {
// test failed in before hook
return;
Expand Down

0 comments on commit b3b1c71

Please sign in to comment.