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

Commit b3b1c71

Browse files
TenzianDavertMik
authored andcommitted
src/ResultPrinter/HTML.php: Unique Test Signatures (#10)
- add fix for #4 to branch 6.0
1 parent 7481881 commit b3b1c71

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/ResultPrinter/HTML.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public function endTest(\PHPUnit\Framework\Test $test, $time)
123123
);
124124

125125
$failures = '';
126-
$name = Descriptor::getTestSignature($test);
126+
$name = Descriptor::getTestSignatureUnique($test);
127127
if (isset($this->failures[$name])) {
128128
$failTemplate = new \Text_Template(
129129
$this->templatePath . 'fail.html'
@@ -236,7 +236,7 @@ protected function endRun()
236236
*/
237237
public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
238238
{
239-
$this->failures[Descriptor::getTestSignature($test)][] = $this->cleanMessage($e);
239+
$this->failures[Descriptor::getTestSignatureUnique($test)][] = $this->cleanMessage($e);
240240
parent::addError($test, $e, $time);
241241
}
242242

@@ -249,18 +249,18 @@ public function addError(\PHPUnit\Framework\Test $test, \Exception $e, $time)
249249
*/
250250
public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, $time)
251251
{
252-
$this->failures[Descriptor::getTestSignature($test)][] = $this->cleanMessage($e);
252+
$this->failures[Descriptor::getTestSignatureUnique($test)][] = $this->cleanMessage($e);
253253
parent::addFailure($test, $e, $time);
254254
}
255-
255+
256256
/**
257257
* Starts test.
258258
*
259259
* @param \PHPUnit\Framework\Test $test
260260
*/
261261
public function startTest(\PHPUnit\Framework\Test $test)
262262
{
263-
$name = Descriptor::getTestSignature($test);
263+
$name = Descriptor::getTestSignatureUnique($test);
264264
if (isset($this->failures[$name])) {
265265
// test failed in before hook
266266
return;

0 commit comments

Comments
 (0)