@@ -15,8 +15,8 @@ final class Issue5891Test extends TestCase
1515{
1616 public function testVariadicParam (): void
1717 {
18- $ variadicParam = $ this ->createMock (VariadicParam ::class);
19- $ variadicParam
18+ $ mock = $ this ->createMock (ArgumentList ::class);
19+ $ mock
2020 ->method ('foo ' )
2121 ->with ($ this ->callback (static function (...$ items ): bool
2222 {
@@ -25,31 +25,31 @@ public function testVariadicParam(): void
2525 return true ;
2626 }));
2727
28- $ variadicParam ->foo (1 , 2 , 3 );
28+ $ mock ->foo (1 , 2 , 3 );
2929 }
3030
3131 public function testTwoParametersAndVariadicParam (): void
3232 {
33- $ twoParametersAndVariadicParam = $ this ->createMock (TwoParametersAndVariadicParam ::class);
34- $ twoParametersAndVariadicParam
33+ $ mock = $ this ->createMock (TwoParametersAndArgumentList ::class);
34+ $ mock
3535 ->method ('foo ' )
36- ->with ($ this ->callback (static function ($ head , ...$ tail ): bool
36+ ->with ($ this ->callback (static function (...$ items ): bool
3737 {
38- self ::assertSame ('1st ' , $ head );
39- self ::assertSame (['2nd ' , '3rd ' , '4th ' ], $ tail );
38+ self ::assertSame (['1st ' , '2nd ' , '3rd ' , '4th ' ], $ items );
4039
4140 return true ;
4241 }));
4342
44- $ twoParametersAndVariadicParam ->foo ('1st ' , '2nd ' , '3rd ' , '4th ' );
43+ $ mock ->foo ('1st ' , '2nd ' , '3rd ' , '4th ' );
4544 }
4645}
4746
48- interface VariadicParam
47+ interface ArgumentList
4948{
5049 public function foo (int ...$ items ): void ;
5150}
52- interface TwoParametersAndVariadicParam
51+
52+ interface TwoParametersAndArgumentList
5353{
5454 public function foo (string $ first , string $ second , string ...$ rest ): void ;
5555}
0 commit comments