|
5 | 5 | namespace Tests\MichaelPetri\PhpunitConsecutiveArguments; |
6 | 6 |
|
7 | 7 | use MichaelPetri\PhpunitConsecutiveArguments\ConsecutiveArguments; |
| 8 | +use PHPUnit\Framework\Constraint\IsAnything; |
8 | 9 | use PHPUnit\Framework\TestCase; |
9 | 10 | use Tests\MichaelPetri\PhpunitConsecutiveArguments\Stub\MockableConsecutiveArgumentInterface; |
10 | 11 |
|
@@ -145,4 +146,22 @@ public function testOnMethodWithVariadicParameter(): void |
145 | 146 | $this->mock->variadic('2.1', '2.2', '2.3'); |
146 | 147 | $this->mock->variadic('3.1', '3.2', '3.3'); |
147 | 148 | } |
| 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 | + } |
148 | 167 | } |
0 commit comments