From 1c004af0baaa0adb6456f2a758e380dc1d87f204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Wer=C5=82os?= Date: Sun, 8 Sep 2024 22:08:09 +0200 Subject: [PATCH] Renaming --- tests/end-to-end/regression/5891.phpt | 2 +- .../regression/5891/Issue5891Test.php | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/end-to-end/regression/5891.phpt b/tests/end-to-end/regression/5891.phpt index 1cb93e8e9d9..934ea0944ae 100644 --- a/tests/end-to-end/regression/5891.phpt +++ b/tests/end-to-end/regression/5891.phpt @@ -17,4 +17,4 @@ Runtime: %s Time: %s, Memory: %s MB -OK (2 tests, 3 assertions) +OK (2 tests, 2 assertions) diff --git a/tests/end-to-end/regression/5891/Issue5891Test.php b/tests/end-to-end/regression/5891/Issue5891Test.php index ea553c066e9..d22c5ed846d 100644 --- a/tests/end-to-end/regression/5891/Issue5891Test.php +++ b/tests/end-to-end/regression/5891/Issue5891Test.php @@ -15,8 +15,8 @@ final class Issue5891Test extends TestCase { public function testVariadicParam(): void { - $variadicParam = $this->createMock(VariadicParam::class); - $variadicParam + $mock = $this->createMock(ArgumentList::class); + $mock ->method('foo') ->with($this->callback(static function (...$items): bool { @@ -25,31 +25,31 @@ public function testVariadicParam(): void return true; })); - $variadicParam->foo(1, 2, 3); + $mock->foo(1, 2, 3); } public function testTwoParametersAndVariadicParam(): void { - $twoParametersAndVariadicParam = $this->createMock(TwoParametersAndVariadicParam::class); - $twoParametersAndVariadicParam + $mock = $this->createMock(TwoParametersAndArgumentList::class); + $mock ->method('foo') - ->with($this->callback(static function ($head, ...$tail): bool + ->with($this->callback(static function (...$items): bool { - self::assertSame('1st', $head); - self::assertSame(['2nd', '3rd', '4th'], $tail); + self::assertSame(['1st', '2nd', '3rd', '4th'], $items); return true; })); - $twoParametersAndVariadicParam->foo('1st', '2nd', '3rd', '4th'); + $mock->foo('1st', '2nd', '3rd', '4th'); } } -interface VariadicParam +interface ArgumentList { public function foo(int ...$items): void; } -interface TwoParametersAndVariadicParam + +interface TwoParametersAndArgumentList { public function foo(string $first, string $second, string ...$rest): void; }