You are here

protected function SimplesitemapTestBase::setUp in Simple XML sitemap 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/SimplesitemapTestBase.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTestBase::setUp()
  2. 8.2 tests/src/Functional/SimplesitemapTestBase.php \Drupal\Tests\simple_sitemap\Functional\SimplesitemapTestBase::setUp()

Overrides BrowserTestBase::setUp

1 call to SimplesitemapTestBase::setUp()
SimpleSitemapViewsTestBase::setUp in modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php
1 method overrides SimplesitemapTestBase::setUp()
SimpleSitemapViewsTestBase::setUp in modules/simple_sitemap_views/tests/src/Functional/SimpleSitemapViewsTestBase.php

File

tests/src/Functional/SimplesitemapTestBase.php, line 81

Class

SimplesitemapTestBase
Provides the base class for web tests for Simple sitemap.

Namespace

Drupal\Tests\simple_sitemap\Functional

Code

protected function setUp() {
  parent::setUp();
  $this->generator = $this->container
    ->get('simple_sitemap.generator');
  $this->database = $this->container
    ->get('database');
  $this
    ->drupalCreateContentType([
    'type' => 'page',
  ]);
  $this->node = $this
    ->createNode([
    'title' => 'Node',
    'type' => 'page',
  ]);
  $this->node2 = $this
    ->createNode([
    'title' => 'Node2',
    'type' => 'page',
  ]);

  // Create a user with all the permissions.
  $permissions = array_keys($this->container
    ->get('user.permissions')
    ->getPermissions());
  $this->privilegedUser = $this
    ->drupalCreateUser($permissions);
}