Skip to content
This repository was archived by the owner on Mar 12, 2025. It is now read-only.

src/ResultPrinter/HTML.php: Unique Test Signatures (branch 6.0) #10

Merged
merged 2 commits into from
Mar 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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