function ViewsDataTest::setUp
Overrides UnitTestCase::setUp
File
-
core/
modules/ views/ tests/ src/ Unit/ ViewsDataTest.php, line 63
Class
- ViewsDataTest
- @coversDefaultClass \Drupal\views\ViewsData[[api-linebreak]] @group views
Namespace
Drupal\Tests\views\UnitCode
protected function setUp() : void {
parent::setUp();
$this->cacheTagsInvalidator = $this->createMock('Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface');
$this->cacheBackend = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
$this->getContainerWithCacheTagsInvalidator($this->cacheTagsInvalidator);
$this->moduleHandler = $this->createMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
$this->languageManager = $this->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
$this->languageManager
->expects($this->any())
->method('getCurrentLanguage')
->willReturn(new Language([
'id' => 'en',
]));
$this->viewsData = new ViewsData($this->cacheBackend, $this->moduleHandler, $this->languageManager);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.