Skip to content

Commit 3414196

Browse files
[Tests] Remove withConsecutive() calls from tests
1 parent 1652a67 commit 3414196

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Tests/EventListener/TemplateAttributeListenerTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,18 @@ public function testAttribute()
2929
$twig = $this->createMock(Environment::class);
3030
$twig->expects($this->exactly(3))
3131
->method('render')
32-
->withConsecutive(
33-
['templates/foo.html.twig', ['foo' => 'bar']],
34-
['templates/foo.html.twig', ['bar' => 'Bar', 'buz' => 'def']],
35-
['templates/foo.html.twig', []],
36-
)
37-
->willReturn('Bar');
32+
->willReturnCallback(function (...$args) {
33+
static $series = [
34+
['templates/foo.html.twig', ['foo' => 'bar']],
35+
['templates/foo.html.twig', ['bar' => 'Bar', 'buz' => 'def']],
36+
['templates/foo.html.twig', []],
37+
];
38+
39+
$this->assertSame(array_shift($series), $args);
40+
41+
return 'Bar';
42+
})
43+
;
3844

3945
$request = new Request();
4046
$kernel = $this->createMock(HttpKernelInterface::class);

0 commit comments

Comments
 (0)