You are here

protected function OptionsTestBase::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/options/src/Tests/Views/OptionsTestBase.php \Drupal\options\Tests\Views\OptionsTestBase::setUp()

Parameters

bool $import_test_views: Should the views specififed on the test class be imported. If you need to setup some additional stuff, like fields, you need to call false and then call createTestViews for your own.

Overrides ViewKernelTestBase::setUp

1 call to OptionsTestBase::setUp()
ViewsDataTest::setUp in core/modules/options/src/Tests/Views/ViewsDataTest.php
Performs setup tasks before each individual test method is run.
1 method overrides OptionsTestBase::setUp()
ViewsDataTest::setUp in core/modules/options/src/Tests/Views/ViewsDataTest.php
Performs setup tasks before each individual test method is run.

File

core/modules/options/src/Tests/Views/OptionsTestBase.php, line 50
Contains \Drupal\options\Tests\Views\OptionsTestBase.

Class

OptionsTestBase
Base class for options views tests.

Namespace

Drupal\options\Tests\Views

Code

protected function setUp() {
  parent::setUp();
  $this
    ->mockStandardInstall();
  ViewTestData::createTestViews(get_class($this), [
    'options_test_views',
  ]);
  $settings = [];
  $settings['type'] = 'article';
  $settings['title'] = $this
    ->randomString();
  $settings['field_test_list_string'][]['value'] = $this->fieldValues[0];
  $settings['field_test_list_integer'][]['value'] = 0;
  $node = Node::create($settings);
  $node
    ->save();
  $this->nodes[] = $node;
  $node = $node
    ->createDuplicate();
  $node
    ->save();
  $this->nodes[] = $node;
}