You are here

protected function ViewsDataTest::setUp in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/views/tests/src/Unit/ViewsDataTest.php \Drupal\Tests\views\Unit\ViewsDataTest::setUp()
  2. 8 core/modules/options/src/Tests/Views/ViewsDataTest.php \Drupal\options\Tests\Views\ViewsDataTest::setUp()
Same name and namespace in other branches
  1. 8.0 core/modules/views/tests/src/Unit/ViewsDataTest.php \Drupal\Tests\views\Unit\ViewsDataTest::setUp()

Overrides UnitTestCase::setUp

File

core/modules/views/tests/src/Unit/ViewsDataTest.php, line 66
Contains \Drupal\Tests\views\Unit\ViewsDataTest.

Class

ViewsDataTest
@coversDefaultClass \Drupal\views\ViewsData @group views

Namespace

Drupal\Tests\views\Unit

Code

protected function setUp() {
  $this->cacheTagsInvalidator = $this
    ->getMock('Drupal\\Core\\Cache\\CacheTagsInvalidatorInterface');
  $this->cacheBackend = $this
    ->getMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this
    ->getContainerWithCacheTagsInvalidator($this->cacheTagsInvalidator);
  $configs = array();
  $configs['views.settings']['skip_cache'] = FALSE;
  $this->configFactory = $this
    ->getConfigFactoryStub($configs);
  $this->moduleHandler = $this
    ->getMock('Drupal\\Core\\Extension\\ModuleHandlerInterface');
  $this->languageManager = $this
    ->getMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->languageManager
    ->expects($this
    ->any())
    ->method('getCurrentLanguage')
    ->will($this
    ->returnValue(new Language(array(
    'id' => 'en',
  ))));
  $this->viewsData = new ViewsData($this->cacheBackend, $this->configFactory, $this->moduleHandler, $this->languageManager);
}