Skip to content

Commit

Permalink
[Tests] Remove withConsecutive() calls from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandre-daubois committed Mar 10, 2023
1 parent 1652a67 commit 3414196
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions Tests/EventListener/TemplateAttributeListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,18 @@ public function testAttribute()
$twig = $this->createMock(Environment::class);
$twig->expects($this->exactly(3))
->method('render')
->withConsecutive(
['templates/foo.html.twig', ['foo' => 'bar']],
['templates/foo.html.twig', ['bar' => 'Bar', 'buz' => 'def']],
['templates/foo.html.twig', []],
)
->willReturn('Bar');
->willReturnCallback(function (...$args) {
static $series = [
['templates/foo.html.twig', ['foo' => 'bar']],
['templates/foo.html.twig', ['bar' => 'Bar', 'buz' => 'def']],
['templates/foo.html.twig', []],
];

$this->assertSame(array_shift($series), $args);

return 'Bar';
})
;

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

0 comments on commit 3414196

Please sign in to comment.