Skip to content

Commit 77c2d48

Browse files
author
Michael Petri
committed
added test case
1 parent 470fed3 commit 77c2d48

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

tests/ConsecutiveArgumentsTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Tests\MichaelPetri\PhpunitConsecutiveArguments;
66

77
use MichaelPetri\PhpunitConsecutiveArguments\ConsecutiveArguments;
8+
use PHPUnit\Framework\Constraint\IsAnything;
89
use PHPUnit\Framework\TestCase;
910
use Tests\MichaelPetri\PhpunitConsecutiveArguments\Stub\MockableConsecutiveArgumentInterface;
1011

@@ -145,4 +146,22 @@ public function testOnMethodWithVariadicParameter(): void
145146
$this->mock->variadic('2.1', '2.2', '2.3');
146147
$this->mock->variadic('3.1', '3.2', '3.3');
147148
}
149+
150+
public function testWithAnythingCallback(): void
151+
{
152+
$this->mock
153+
->expects(self::exactly(3))
154+
->method('variadic')
155+
->with(
156+
...ConsecutiveArguments::of(
157+
[new IsAnything(), '1.2', '1.3'],
158+
['2.1', new IsAnything(), '2.3'],
159+
['3.1', '3.2', new IsAnything()],
160+
)
161+
);
162+
163+
$this->mock->variadic('1.1', '1.2', '1.3');
164+
$this->mock->variadic('2.1', '2.2', '2.3');
165+
$this->mock->variadic('3.1', '3.2', '3.3');
166+
}
148167
}

0 commit comments

Comments
 (0)