Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos authored and sebastianbergmann committed Sep 9, 2024
1 parent 18911e5 commit 1c004af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion tests/end-to-end/regression/5891.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ Runtime: %s

Time: %s, Memory: %s MB

OK (2 tests, 3 assertions)
OK (2 tests, 2 assertions)
22 changes: 11 additions & 11 deletions tests/end-to-end/regression/5891/Issue5891Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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;
}

0 comments on commit 1c004af

Please sign in to comment.