function ViewsNoResultsBehaviorTest::setUp

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php \Drupal\Tests\views\Functional\ViewsNoResultsBehaviorTest::setUp()
  2. 10 core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php \Drupal\Tests\views\Functional\ViewsNoResultsBehaviorTest::setUp()
  3. 11.x core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php \Drupal\Tests\views\Functional\ViewsNoResultsBehaviorTest::setUp()

Overrides ViewTestBase::setUp

File

core/modules/views/tests/src/Functional/ViewsNoResultsBehaviorTest.php, line 27

Class

ViewsNoResultsBehaviorTest
Tests no results behavior.

Namespace

Drupal\Tests\views\Functional

Code

protected function setUp($import_test_views = TRUE, $modules = []) : void {
    parent::setUp($import_test_views, $modules);
    $this->enableViewsTestModule();
    $user = $this->createUser([], NULL, TRUE);
    $this->drupalLogin($user);
    // Set the Stark theme and use the default templates from views module.
    
    /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
    $theme_installer = \Drupal::service('theme_installer');
    $theme_installer->install([
        'stark',
    ]);
    $this->config('system.theme')
        ->set('default', 'stark')
        ->save();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.