You are here

protected function TermLevelFieldTest::setUp in Term Level Field 8

Prepare test user and test vocabulary with test terms.

Overrides BrowserTestBase::setUp

File

tests/src/Functional/TermLevelFieldTest.php, line 65

Class

TermLevelFieldTest
Tests the functionality of Term level field type in BrowserTestBase tests.

Namespace

Drupal\Tests\term_level\Functional

Code

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

  // Create test CV content type.
  $this
    ->createContentType([
    'type' => 'curriculum_vitae',
  ]);

  // Create random test vocabulary.
  $this->vocabulary = $this
    ->createVocabulary();

  // Create test terms.
  foreach ($this->termNames as $term_name) {
    $this->terms[$term_name] = $this
      ->createTerm($this->vocabulary, [
      'name' => $term_name,
    ]);
  }
}