You are here

protected function HierarchicalTermFormatterTest::setUp in Hierarchical Term Formatter 8

Overrides BrowserTestBase::setUp

File

tests/src/Functional/HierarchicalTermFormatterTest.php, line 76

Class

HierarchicalTermFormatterTest
Verifies Hierarchical Term Formatter.

Namespace

Drupal\Tests\hierarchical_term_formatter\Functional

Code

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

  // Create a tree we can work on.
  $items = [
    '1' => [
      '1.1' => [
        '1.1.1' => [
          '1.1.1.1',
          '1.1.1.2',
        ],
        '1.1.2' => '1.1.2',
        '1.1.3' => '1.1.3',
      ],
      '1.2' => '1.2',
    ],
    '2' => [
      '2.1',
      '2.2',
    ],
  ];
  $this
    ->createTerms($items);

  // Create a user with proper permissions.
  $this->user = $this
    ->drupalCreateUser([
    'preview node view modes',
  ]);
}