Skip to content

Commit 6f2775c

Browse files
Merge branch '11.5' into 12.1
2 parents 3647ca0 + fd2e863 commit 6f2775c

File tree

5 files changed

+17
-44
lines changed

5 files changed

+17
-44
lines changed

ChangeLog-12.1.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 12.1 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [12.1.2] - 2025-04-08
6+
7+
### Fixed
8+
9+
* [#6104](https://github.com/sebastianbergmann/phpunit/issues/6104): Reverted change introduced in PHPUnit 12.1.1
10+
511
## [12.1.1] - 2025-04-08
612

713
### Fixed
@@ -26,5 +32,6 @@ All notable changes of the PHPUnit 12.1 release series are documented in this fi
2632

2733
* [#6140](https://github.com/sebastianbergmann/phpunit/issues/6140): The `testClassName()` method on the `AfterTestMethodCalled`, `AfterTestMethodErrored`, `AfterTestMethodFinished`, `BeforeTestMethodCalled`, `BeforeTestMethodErrored`, `BeforeTestMethodFinished`, `PostConditionCalled`, `PostConditionErrored`, `PostConditionFinished`, `PreConditionCalled`, `PreConditionErrored`, and `PreConditionFinished` event value objects (use `test()->className()` instead)
2834

35+
[12.1.2]: https://github.com/sebastianbergmann/phpunit/compare/12.1.1...12.1.2
2936
[12.1.1]: https://github.com/sebastianbergmann/phpunit/compare/12.1.0...12.1.1
3037
[12.1.0]: https://github.com/sebastianbergmann/phpunit/compare/12.0.10...12.1.0

src/Framework/TestCase.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1250,24 +1250,14 @@ protected function onNotSuccessfulTest(Throwable $t): never
12501250
*/
12511251
private function runTest(): mixed
12521252
{
1253-
$testArguments = array_merge($this->data, array_values($this->dependencyInput));
1254-
$positionalArguments = [];
1255-
$namedArguments = [];
1256-
1257-
foreach ($testArguments as $key => $value) {
1258-
if (is_int($key)) {
1259-
$positionalArguments[] = $value;
1260-
} else {
1261-
$namedArguments[$key] = $value;
1262-
}
1263-
}
1253+
$testArguments = array_merge($this->data, array_values($this->dependencyInput));
12641254

12651255
$capture = tmpfile();
12661256
$errorLogPrevious = ini_set('error_log', stream_get_meta_data($capture)['uri']);
12671257

12681258
try {
12691259
/** @phpstan-ignore method.dynamicName */
1270-
$testResult = $this->{$this->methodName}(...$namedArguments, ...$positionalArguments);
1260+
$testResult = $this->{$this->methodName}(...$testArguments);
12711261

12721262
$errorLogOutput = stream_get_contents($capture);
12731263

src/Runner/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function id(): string
3434
}
3535

3636
if (self::$version === '') {
37-
self::$version = (new VersionId('12.1.1', dirname(__DIR__, 2)))->asString();
37+
self::$version = (new VersionId('12.1.2', dirname(__DIR__, 2)))->asString();
3838
}
3939

4040
return self::$version;

tests/end-to-end/data-provider/dependency-result.phpt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ PHPUnit %s by Sebastian Bergmann and contributors.
1313

1414
Runtime: %s
1515

16-
.... 4 / 4 (100%)
16+
...E 4 / 4 (100%)
1717

1818
Time: %s, Memory: %s
1919

20-
OK (4 tests, 7 assertions)
20+
There was 1 error:
2121

22+
1) PHPUnit\TestFixture\DataProviderDependencyResultTest::testAdd with data set #2 (2, 0)
23+
Error: Cannot use positional argument after named argument during unpacking
24+
25+
ERRORS!
26+
Tests: 4, Assertions: 5, Errors: 1.

tests/unit/Framework/TestCaseTest.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
use function sprintf;
1313
use PHPUnit\Framework\Attributes\CoversClass;
14-
use PHPUnit\Framework\Attributes\DataProvider;
15-
use PHPUnit\Framework\Attributes\Depends;
1614
use PHPUnit\Framework\Attributes\ExcludeGlobalVariableFromBackup;
1715
use PHPUnit\TestFixture\TestWithDifferentNames;
1816

@@ -23,18 +21,6 @@ class TestCaseTest extends TestCase
2321
{
2422
protected static int $testStatic = 456;
2523

26-
/**
27-
* @return array<non-empty-string, array<non-empty-string, string>>
28-
*/
29-
public static function provider(): array
30-
{
31-
return [
32-
'case 1' => [
33-
'fromProvider' => 'value from provider',
34-
],
35-
];
36-
}
37-
3824
public static function setUpBeforeClass(): void
3925
{
4026
$GLOBALS['a'] = 'a';
@@ -97,19 +83,4 @@ public function testGetNameReturnsMethodName(): void
9783

9884
$this->assertSame($methodName, $testCase->nameWithDataSet());
9985
}
100-
101-
public function testDependedUponTest(): string
102-
{
103-
$this->assertTrue(true);
104-
105-
return 'value from depended-upon test';
106-
}
107-
108-
#[DataProvider('provider')]
109-
#[Depends('testDependedUponTest')]
110-
public function testTestDataFromProviderAndDependedUponTest(string $fromProvider, string $fromDependency): void
111-
{
112-
$this->assertSame('value from provider', $fromProvider);
113-
$this->assertSame('value from depended-upon test', $fromDependency);
114-
}
11586
}

0 commit comments

Comments
 (0)