Skip to content

Commit fd2e863

Browse files
Revert fix for #6104 for now
1 parent 8c37a98 commit fd2e863

File tree

5 files changed

+17
-44
lines changed

5 files changed

+17
-44
lines changed

ChangeLog-11.5.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 11.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

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

713
### Fixed
@@ -154,6 +160,7 @@ All notable changes of the PHPUnit 11.5 release series are documented in this fi
154160
* [#6055](https://github.com/sebastianbergmann/phpunit/issues/6055): `assertNotContainsOnly()` (use `assertContainsNotOnlyArray()`, `assertContainsNotOnlyBool()`, `assertContainsNotOnlyCallable()`, `assertContainsNotOnlyFloat()`, `assertContainsNotOnlyInt()`, `assertContainsNotOnlyIterable()`, `assertContainsNotOnlyNumeric()`, `assertContainsNotOnlyObject()`, `assertContainsNotOnlyResource()`, `assertContainsNotOnlyClosedResource()`, `assertContainsNotOnlyScalar()`, or `assertContainsNotOnlyString()` instead)
155161
* [#6059](https://github.com/sebastianbergmann/phpunit/issues/6059): `containsOnly()` (use `containsOnlyArray()`, `containsOnlyBool()`, `containsOnlyCallable()`, `containsOnlyFloat()`, `containsOnlyInt()`, `containsOnlyIterable()`, `containsOnlyNumeric()`, `containsOnlyObject()`, `containsOnlyResource()`, `containsOnlyClosedResource()`, `containsOnlyScalar()`, or `containsOnlyString()` instead)
156162

163+
[11.5.17]: https://github.com/sebastianbergmann/phpunit/compare/11.5.16...11.5.17
157164
[11.5.16]: https://github.com/sebastianbergmann/phpunit/compare/11.5.15...11.5.16
158165
[11.5.15]: https://github.com/sebastianbergmann/phpunit/compare/11.5.14...11.5.15
159166
[11.5.14]: https://github.com/sebastianbergmann/phpunit/compare/11.5.13...11.5.14

src/Framework/TestCase.php

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,20 +1650,10 @@ protected function onNotSuccessfulTest(Throwable $t): never
16501650
*/
16511651
private function runTest(): mixed
16521652
{
1653-
$testArguments = array_merge($this->data, array_values($this->dependencyInput));
1654-
$positionalArguments = [];
1655-
$namedArguments = [];
1656-
1657-
foreach ($testArguments as $key => $value) {
1658-
if (is_int($key)) {
1659-
$positionalArguments[] = $value;
1660-
} else {
1661-
$namedArguments[$key] = $value;
1662-
}
1663-
}
1653+
$testArguments = array_merge($this->data, array_values($this->dependencyInput));
16641654

16651655
try {
1666-
$testResult = $this->{$this->methodName}(...$namedArguments, ...$positionalArguments);
1656+
$testResult = $this->{$this->methodName}(...$testArguments);
16671657
} catch (Throwable $exception) {
16681658
if (!$this->shouldExceptionExpectationsBeVerified($exception)) {
16691659
throw $exception;

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('11.5.16', dirname(__DIR__, 2)))->asString();
37+
self::$version = (new VersionId('11.5.17', 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)