public function testInvalidation(IdsCollection
$ids, int
$depth, \Closure
$before, \Closure
$after, int
$calls): void
{ // to improve performance, we generate the required data one time and test different case with same data set
$this->
initData($ids);
$this->
getContainer()->
get('cache.object'
)->
invalidateTags([self::ALL_TAG
]);
$this->
getContainer()->
get('event_dispatcher'
) ->
addListener(NavigationRouteCacheTagsEvent::
class,
static function DNavigationRouteCacheTagsEvent
$event): void
{ $event->
addTags([self::ALL_TAG
]);
});
$route =
$this->
getContainer()->
get(NavigationRoute::
class);
$listener =
$this->
getMockBuilder(CallableClass::
class)->
getMock();
$listener->
expects(static::
exactly($calls))->
method('__invoke'
);
$this->
getContainer() ->
get('event_dispatcher'
) ->
addListener(NavigationRouteCacheTagsEvent::
class,
$listener);