You are here

protected function SimplesitemapTestBase::setUp in Simple XML sitemap 8.2

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

Overrides BrowserTestBase::setUp

File

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

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 an user with all the permissions.
  $permissions = array_keys($this->container
    ->get('user.permissions')
    ->getPermissions());
  $this->privilegedUser = $this
    ->drupalCreateUser($permissions);
}