protected function TokenTest::setUp in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/Tests/Core/Utility/TokenTest.php \Drupal\Tests\Core\Utility\TokenTest::setUp()
- 10 core/tests/Drupal/Tests/Core/Utility/TokenTest.php \Drupal\Tests\Core\Utility\TokenTest::setUp()
Overrides UnitTestCase::setUp
File
- core/
tests/ Drupal/ Tests/ Core/ Utility/ TokenTest.php, line 79
Class
- TokenTest
- @coversDefaultClass \Drupal\Core\Utility\Token @group Utility
Namespace
Drupal\Tests\Core\UtilityCode
protected function setUp() {
$this->cache = $this
->createMock('\\Drupal\\Core\\Cache\\CacheBackendInterface');
$this->languageManager = $this
->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$this->moduleHandler = $this
->createMock('\\Drupal\\Core\\Extension\\ModuleHandlerInterface');
$this->language = $this
->createMock('\\Drupal\\Core\\Language\\LanguageInterface');
$this->cacheTagsInvalidator = $this
->createMock('\\Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface');
$this->renderer = $this
->createMock('Drupal\\Core\\Render\\RendererInterface');
$this->token = new Token($this->moduleHandler, $this->cache, $this->languageManager, $this->cacheTagsInvalidator, $this->renderer);
$container = new ContainerBuilder();
$this->cacheContextManager = new CacheContextsManager($container, [
'current_user',
'custom_context',
]);
$container
->set('cache_contexts_manager', $this->cacheContextManager);
\Drupal::setContainer($container);
}