You are here

public function AutologoutAjaxTest::setUp in Automated Logout 8

SetUp() performs any pre-requisite tasks that need to happen.

Overrides BrowserTestBase::setUp

File

tests/src/Functional/AutologoutAjaxTest.php, line 48

Class

AutologoutAjaxTest
Test the Autologout ajax endpoints.

Namespace

Drupal\Tests\autologout\Functional

Code

public function setUp() {
  parent::setUp();

  // Create and log in our privileged user.
  $this->privilegedUser = $this
    ->drupalCreateUser([
    'access content',
    'administer site configuration',
    'access site reports',
    'access administration pages',
    'bypass node access',
    'administer content types',
    'administer nodes',
    'administer autologout',
    'change own logout threshold',
  ]);
  $this
    ->drupalLogin($this->privilegedUser);

  // Make node page default.
  $this
    ->config('system.site')
    ->set('page.front', 'node')
    ->save();
  $this->moduleConfig = $this->container
    ->get('config.factory')
    ->getEditable('autologout.settings');
}