You are here

TermMergeTestBase.php in Term Merge 8

File

tests/src/Functional/TermMergeTestBase.php
View source
<?php

namespace Drupal\Tests\term_merge\Functional;

use Drupal\Tests\BrowserTestBase;
use Drupal\Tests\field\Traits\EntityReferenceTestTrait;
use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;

/**
 * Provides a base class for Term Merge functional tests.
 */
abstract class TermMergeTestBase extends BrowserTestBase {
  use TaxonomyTestTrait;
  use EntityReferenceTestTrait;

  /**
   * {@inheritdoc}
   */
  public static $modules = [
    'node',
    'taxonomy',
    'term_merge',
    'term_merge_test_events',
  ];

  /**
   * The content type.
   *
   * @var \Drupal\node\Entity\NodeType
   */
  protected $contentType;

  /**
   * The vocabulary.
   *
   * @var \Drupal\taxonomy\Entity\Vocabulary
   */
  protected $vocabulary;

  /**
   * The logged in user.
   *
   * @var \Drupal\user\Entity\User
   */
  protected $user;

  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';

  /**
   * {@inheritdoc}
   */
  public function setUp() {
    parent::setUp();
    $this->contentType = $this
      ->drupalCreateContentType();
    $this->vocabulary = $this
      ->createVocabulary();
    $this
      ->createEntityReferenceField('node', $this->contentType
      ->id(), 'field_tags', 'Tags', 'taxonomy_term', 'default', [], -1);
  }

}

Classes

Namesort descending Description
TermMergeTestBase Provides a base class for Term Merge functional tests.