You are here

protected function SmartTitleBrowserTestBase::setUp in Smart Title 8

Overrides BrowserTestBase::setUp

1 call to SmartTitleBrowserTestBase::setUp()
SmartTitleConfigTest::setUp in tests/src/Functional/SmartTitleConfigTest.php
1 method overrides SmartTitleBrowserTestBase::setUp()
SmartTitleConfigTest::setUp in tests/src/Functional/SmartTitleConfigTest.php

File

tests/src/Functional/SmartTitleBrowserTestBase.php, line 50

Class

SmartTitleBrowserTestBase
Base class to provide common test setup for Smart Title functional tests.

Namespace

Drupal\Tests\smart_title\Functional

Code

protected function setUp() {
  parent::setUp();
  $this
    ->drupalPlaceBlock('local_tasks_block');
  $this
    ->drupalPlaceBlock('system_main_block');
  $this
    ->config('system.site')
    ->set('page.front', '/node')
    ->save();

  // Create test_block and test_page node types.
  $this
    ->drupalCreateContentType([
    'type' => 'test_page',
    'name' => 'Test page',
    'display_submitted' => FALSE,
  ]);

  // Add Smart Title for test_page.
  $this
    ->config('smart_title.settings')
    ->set('smart_title', [
    'node:test_page',
  ])
    ->save();
  $this
    ->rebuildAll();

  // Add test node.
  $this->testPageNode = $this
    ->drupalCreateNode([
    'type' => 'test_page',
  ]);

  // Create users and test node.
  $this->adminUser = $this
    ->drupalCreateUser([
    'access content overview',
    'access content',
    'administer site configuration',
    'administer content types',
    'administer display modes',
    'administer node display',
    'administer node fields',
    'administer node form display',
    'administer nodes',
    'create test_page content',
  ]);
}