You are here

protected function DfpTestBase::setUp in Doubleclick for Publishers (DFP) 8

Overrides BrowserTestBase::setUp

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

File

tests/src/Functional/DfpTestBase.php, line 37
Contains \Drupal\Tests\dfp\Functional\DfpTestBase.

Class

DfpTestBase
An abstract class to build DFP tests from.

Namespace

Drupal\Tests\dfp\Functional

Code

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

  // Create an admin user with all the permissions needed to run tests.
  $this->adminUser = $this
    ->drupalCreateUser([
    'administer DFP',
    'access administration pages',
    'administer blocks',
  ]);
  $this
    ->drupalLogin($this->adminUser);

  // Set up global settings needed for DFP ads to work.
  \Drupal::configFactory()
    ->getEditable('dfp.settings')
    ->set('network_id', '12345')
    ->set('default_slug', 'Global DFP slug')
    ->save();
}