You are here

public function CustomFilterTest::setUp in Custom filter 8

Set up the tests and create the users.

Overrides WebTestBase::setUp

File

src/Tests/CustomFilterTest.php, line 24

Class

CustomFilterTest
Test the Custom Filter administration and use.

Namespace

Drupal\customfilter\Tests

Code

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

  // Create a content type, as we will create nodes on test.
  $settings = array(
    // Override default type (a random name).
    'type' => 'test',
    'name' => 'Test',
  );
  $this
    ->drupalCreateContentType($settings);

  // Create a user with administrative privilegies.
  $this->adminUser = $this
    ->drupalCreateUser(array(
    'administer permissions',
    'administer customfilter',
    'administer filters',
    'administer nodes',
    'access administration pages',
    'create test content',
    'edit any test content',
  ));
  $this
    ->drupalLogin($this->adminUser);
}