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

Commit 12809eb

Browse files
committed
Merge branch '7.0' of github.com:Codeception/phpunit-wrapper into 7.0
2 parents a938533 + 587c963 commit 12809eb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/FilterTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public function accept():bool
2020
}
2121

2222
$name = Descriptor::getTestSignature($test);
23+
$index = Descriptor::getTestDataSetIndex($test);
24+
25+
if (!is_null($index)) {
26+
$name .= " with data set #{$index}";
27+
}
28+
2329
$accepted = preg_match($this->filter, $name, $matches);
2430

2531
if ($accepted && isset($this->filterMax)) {

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)