You are here

protected function MixitUpFiltersFormTest::setUp in MixItUp Views 8.2

Same name and namespace in other branches
  1. 8 tests/src/Kernel/MixitUpFiltersFormTest.php \Drupal\Tests\mixitup_views\Kernel\MixitUpFiltersFormTest::setUp()

Before a test method is run, setUp() is invoked.

Create new unit object.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

\Drupal\Core\Entity\EntityStorageException

Overrides KernelTestBase::setUp

File

tests/src/Kernel/MixitUpFiltersFormTest.php, line 79

Class

MixitUpFiltersFormTest
Class MixitUpFiltersFormTest.

Namespace

Drupal\Tests\mixitup_views\Kernel

Code

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

  // Installing entities schema.
  $this
    ->installSchema('system', [
    'sequences',
    'key_value_expire',
  ]);
  $this
    ->installEntitySchema('user');
  $this
    ->installEntitySchema('taxonomy_term');
  $this
    ->installEntitySchema('taxonomy_vocabulary');
  $this
    ->installEntitySchema('node');

  // Generating test content and creating instance for the class to be tested.
  $this->serviceContainer = \Drupal::getContainer();
  $this->entityTypeManager = $this->serviceContainer
    ->get('entity_type.manager');
  $this->defaultOptions = $this->serviceContainer
    ->get('mixitup_views.default_options_service');
  $this->mixitupFunc = $this->serviceContainer
    ->get('mixitup_views.func_service');
  $this->testObject = new MixitupFiltersForm($this->mixitupFunc);
  $this
    ->generateTestContent();
}