protected function LocalTaskManagerTest::setupNullCacheabilityMetadataValidation in Drupal 8
1 call to LocalTaskManagerTest::setupNullCacheabilityMetadataValidation()
- LocalTaskManagerTest::setUp in core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskManagerTest.php
File
- core/
tests/ Drupal/ Tests/ Core/ Menu/ LocalTaskManagerTest.php, line 504
Class
- LocalTaskManagerTest
- @coversDefaultClass \Drupal\Core\Menu\LocalTaskManager @group Menu
Namespace
Drupal\Tests\Core\MenuCode
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',
],
[
'context.example1',
'route',
'context.example2',
],
[
'context.example1',
'context.example2',
'route',
],
[
'context.example1',
'context.example2',
'route',
'user.permissions',
],
] as $argument) {
$cache_context_manager
->assertValidTokens($argument)
->willReturn(TRUE);
}
$container
->set('cache_contexts_manager', $cache_context_manager
->reveal());
\Drupal::setContainer($container);
}