Skip to content

Commit 999004d

Browse files
committed
Fix a PHPUnit 9 deprecation notice
1 parent 10dcc10 commit 999004d

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

tests/DependencyInjection/Compiler/ShortcodeCompilerPassTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,12 @@ public function tagged_services_are_added_as_handlers_to_handler_container(): vo
4646
]);
4747

4848
$mockedShortcodeHandlerContainer = $this->createMock(Definition::class);
49-
$mockedShortcodeHandlerContainer->expects($this->at(0))
49+
$mockedShortcodeHandlerContainer->expects($this->exactly(2))
5050
->method('addMethodCall')
5151
->with('add', $this->callback(function (array $argument) {
52-
return 'shortcode1' === $argument[0]
53-
&& $argument[1] instanceof Reference;
54-
}));
55-
$mockedShortcodeHandlerContainer->expects($this->at(1))
56-
->method('addMethodCall')
57-
->with('add', $this->callback(function ($argument) {
58-
return 'shortcode2' === $argument[0]
59-
&& $argument[1] instanceof Reference;
52+
static $count = 0;
53+
++$count;
54+
return 'shortcode'.$count === $argument[0] && $argument[1] instanceof Reference;
6055
}));
6156

6257
$this->containerBuilder->expects($this->once())

0 commit comments

Comments
 (0)