Skip to content

Commit be6f231

Browse files
Merge branch '12.4' into 12.5
* 12.4: Prepare release remove duplicated test remove XFAIL for fixed test fix --filter format used by PHPStorm Fix namespace fix test with xdebug installed fix cs fix namespace Added regression test
2 parents e294589 + fc5413a commit be6f231

File tree

11 files changed

+102
-31
lines changed

11 files changed

+102
-31
lines changed

src/Framework/TestCase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,10 +860,10 @@ final public function dataSetAsString(): string
860860
{
861861
if ($this->data !== []) {
862862
if (is_int($this->dataName)) {
863-
return sprintf(' with data set %s', $this->dataSetAsFilterString());
863+
return sprintf(' with data set #%s', $this->dataName);
864864
}
865865

866-
return sprintf(' with data set "%s"', $this->dataSetAsFilterString());
866+
return sprintf(' with data set "%s"', $this->dataName);
867867
}
868868

869869
return '';

src/Runner/Filter/NameFilterIterator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private function prepareFilter(string $filter): array
109109
// * testDetermineJsonError@JSON.*
110110
elseif (preg_match('/^(.*?)@(.+)$/', $filter, $matches)) {
111111
$filter = sprintf(
112-
'%s.*with data set "@%s"$',
112+
'%s.*with data set "%s"$',
113113
$matches[1],
114114
$matches[2],
115115
);

tests/end-to-end/cli/filter/filter-dataprovider-by-phpstorm-regex-string-key.phpt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
--TEST--
22
https://github.com/sebastianbergmann/phpunit/pull/6364
3-
--XFAIL--
4-
https://github.com/sebastianbergmann/phpunit/pull/6364
53
--FILE--
64
<?php declare(strict_types=1);
75

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
https://github.com/sebastianbergmann/phpunit/issues/6382
3+
--FILE--
4+
<?php declare(strict_types=1);
5+
$_SERVER['argv'][] = '--do-not-cache-result';
6+
$_SERVER['argv'][] = '--no-configuration';
7+
$_SERVER['argv'][] = __DIR__ . '/6382/Issue6382Test.php';
8+
9+
require_once __DIR__ . '/../../bootstrap.php';
10+
11+
(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
12+
--EXPECTF--
13+
PHPUnit %s by Sebastian Bergmann and contributors.
14+
15+
Runtime: %s
16+
17+
18+
Fatal error: Declaration of PHPUnit\TestFixture\Issue6382\Child6382::__invoke() must be compatible with PHPUnit\TestFixture\Issue6382\Ancestor6382::__invoke(): void in %sChild.php on line %d
19+
%AFatal error: Premature end of PHP process when running PHPUnit\TestFixture\Issue6382\Issue6382Test::testExample.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\Issue6382;
11+
12+
interface Ancestor6382
13+
{
14+
public function __invoke(): void;
15+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\Issue6382;
11+
12+
interface Child6382 extends Ancestor6382
13+
{
14+
public function __invoke();
15+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php declare(strict_types=1);
2+
/*
3+
* This file is part of PHPUnit.
4+
*
5+
* (c) Sebastian Bergmann <[email protected]>
6+
*
7+
* For the full copyright and license information, please view the LICENSE
8+
* file that was distributed with this source code.
9+
*/
10+
namespace PHPUnit\TestFixture\Issue6382;
11+
12+
use PHPUnit\Framework\TestCase;
13+
14+
class Issue6382Test extends TestCase
15+
{
16+
public function testExample(): void
17+
{
18+
require_once __DIR__ . '/Ancestor.php';
19+
20+
require_once __DIR__ . '/Child.php';
21+
22+
new Child6382;
23+
}
24+
}

tests/end-to-end/testdox/data-provider-with-string-data-set-name.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Runtime: %s
2020
Time: %s, Memory: %s
2121

2222
Data Provider With String Data Set Name (PHPUnit\TestFixture\TestDox\DataProviderWithStringDataSetName)
23-
✔ Something that works with data set "@data set name"
24-
✘ Something that does not work with data set "@data set name"
23+
✔ Something that works with data set "data set name"
24+
✘ Something that does not work with data set "data set name"
2525
2626
│ Failed asserting that false is true.
2727

tests/end-to-end/testdox/metadata-data-provider-with-string-data-set-name.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ Runtime: %s
2020
Time: %s, Memory: %s
2121

2222
Text from class-level TestDox metadata
23-
✔ Text from method-level TestDox metadata for successful test with data set "@data set name"
24-
✘ Text from method-level TestDox metadata for failing test with data set "@data set name"
23+
✔ Text from method-level TestDox metadata for successful test with data set "data set name"
24+
✘ Text from method-level TestDox metadata for failing test with data set "data set name"
2525
2626
│ Failed asserting that false is true.
2727

tests/unit/Logging/TestDox/NamePrettifierTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function __toString(): string
163163
false,
164164
],
165165
[
166-
'Two with data set "@a"',
166+
'Two with data set "a"',
167167
$testWithDataWithStringKey,
168168
false,
169169
],

0 commit comments

Comments
 (0)