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

Commit 4de9efc

Browse files
TenzianDavertMik
authored andcommitted
src/ResultPrinter/HTML.php: Use Unique Test Signatures (#5)
Fixes #4 - replace use of Descriptor::getTestSignature with Descriptor::getTestSignatureUnique
1 parent c4def86 commit 4de9efc

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, float $time) : void
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():void
236236
*/
237237
public function addError(\PHPUnit\Framework\Test $test, \Throwable $e, float $time) : void
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, \Throwable $e, float $ti
249249
*/
250250
public function addFailure(\PHPUnit\Framework\Test $test, \PHPUnit\Framework\AssertionFailedError $e, float $time) : void
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):void
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)