You are here

public function TextimageTestBase::setUp in Textimage 8.3

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/TextimageTestBase.php \Drupal\Tests\textimage\Functional\TextimageTestBase::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/TextimageTestBase.php, line 27

Class

TextimageTestBase
Base test class for Textimage tests.

Namespace

Drupal\Tests\textimage\Functional

Code

public function setUp() {
  parent::setUp();
  $this
    ->initTextimageTest();

  // Create Basic page and Article node types.
  if ($this->profile != 'standard') {
    $this
      ->drupalCreateContentType([
      'type' => 'page',
      'name' => 'Basic page',
    ]);
    $this
      ->drupalCreateContentType([
      'type' => 'article',
      'name' => 'Article',
    ]);
  }

  // Create a user and log it in.
  $this->adminUser = $this
    ->drupalCreateUser([
    'access content',
    'create article content',
    'edit any article content',
    'delete any article content',
    'administer site configuration',
    'administer image styles',
    'generate textimage url derivatives',
  ]);
  $this
    ->drupalLogin($this->adminUser);
}