You are here

public function NodeExpireAdminTestCase::setUp in Node expire 8

Same name in this branch
  1. 8 tests/node_expire.admin.test \NodeExpireAdminTestCase::setUp()
  2. 8 src/Tests/NodeExpireAdminTestCase.php \Drupal\node_expire\Tests\NodeExpireAdminTestCase::setUp()

Overrides setUp().

Overrides WebTestBase::setUp

File

src/Tests/NodeExpireAdminTestCase.php, line 27

Class

NodeExpireAdminTestCase
Tests for the administrative UI.

Namespace

Drupal\node_expire\Tests

Code

public function setUp() {
  parent::setUp([
    'rules',
    'node_expire',
  ]);

  // Create test user.
  $this->admin_user = $this
    ->drupalCreateUser([
    'access content',
    'administer content types',
    'administer site configuration',
    'administer modules',
  ]);
  $this
    ->drupalLogin($this->admin_user);

  // Create content type, with underscores.
  $type_name = strtolower($this
    ->randomName(8)) . '_test';
  $type = $this
    ->drupalCreateContentType([
    'name' => $type_name,
    'type' => $type_name,
  ]);
  $this->type = $type->type;

  // Store a valid URL name, with hyphens instead of underscores.
  $this->hyphen_type = str_replace('_', '-', $this->type);
}