You are here

public function JuiceboxConfGlobalCase::setUp in Juicebox HTML5 Responsive Image Galleries 8.2

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/JuiceboxConfGlobalCase.php \Drupal\Tests\juicebox\Functional\JuiceboxConfGlobalCase::setUp()

Define setup tasks.

Overrides BrowserTestBase::setUp

File

tests/src/Functional/JuiceboxConfGlobalCase.php, line 26

Class

JuiceboxConfGlobalCase
Tests global configuration logic for Juicebox galleries.

Namespace

Drupal\Tests\juicebox\Functional

Code

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

  // Create and login user.
  // @todo: Reactivate translation perms when issue #2573975 is resolved.
  // $this->webUser = $this->drupalCreateUser(array('access content', 'access
  // administration pages', 'administer site configuration', 'administer
  // content types', 'administer nodes', 'administer node fields', 'administer
  // node display', 'bypass node access', 'administer languages', 'translate
  // interface'));
  $this->webUser = $this
    ->drupalCreateUser([
    'access content',
    'access administration pages',
    'administer site configuration',
    'administer content types',
    'administer nodes',
    'administer node fields',
    'administer node display',
    'bypass node access',
  ]);
  $this
    ->drupalLogin($this->webUser);

  // Prep a node with an image/file field and create a test entity.
  $this
    ->initNode();

  // Activte the field formatter for our new node instance.
  $this
    ->activateJuiceboxFieldFormatter();

  // Create a test node.
  $this
    ->createNodeWithFile();

  // Start all cases as an anon user.
  $this
    ->drupalLogout();
}