You are here

protected function StyleJumpMenuTest::setUp in Views Jump Menu 8

Overrides ViewTestBase::setUp

File

tests/src/Functional/Plugin/StyleJumpMenuTest.php, line 50

Class

StyleJumpMenuTest
Tests the Jump Menu style views plugin.

Namespace

Drupal\Tests\views_jump_menu\Functional\Plugin

Code

protected function setUp($import_test_views = TRUE) {
  parent::setUp($import_test_views);
  $this
    ->enableViewsTestModule();

  // Add a user with a random name, and get a URL string for that user. Our
  // test view links to users' "view" page (i.e.: rel=canonical), and does not
  // use absolute links, so our URL string should do the same.
  $this->viewsJumpMenuTestUserName = $this
    ->randomMachineName();
  $testUser = $this
    ->drupalCreateUser([], $this->viewsJumpMenuTestUserName);
  $this->viewsJumpMenuTestUserUrlString = $testUser
    ->toUrl('canonical', [
    'absolute' => FALSE,
  ])
    ->toString();
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'access user profiles',
  ]));
}