$this->factory->
expects($this->
any()) ->
method('createInstance'
) ->
willReturnMap($map);
} protected function setupNullCacheabilityMetadataValidation() { $container = \Drupal::
hasContainer() ? \Drupal::
getContainer() :
new ContainerBuilder();
$cache_context_manager =
$this->
prophesize(CacheContextsManager::
class);
foreach ([NULL,
['user.permissions'
],
['route'
],
['route', 'context.example1'
],
['context.example1', 'route'
],
['route', 'context.example1', 'context.example2'
],
['context.example1', 'context.example2', 'route'
],
['route', 'context.example1', 'context.example2', 'user.permissions'
]] as $argument) { $cache_context_manager->
assertValidTokens($argument)->
willReturn(TRUE
);
} $container->
set('cache_contexts_manager',
$cache_context_manager->
reveal());
\Drupal::
setContainer($container);
}}