function OptionsTestBase::setUp

Same name in other branches
  1. 8.9.x core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php \Drupal\Tests\options\Kernel\Views\OptionsTestBase::setUp()
  2. 10 core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php \Drupal\Tests\options\Kernel\Views\OptionsTestBase::setUp()
  3. 11.x core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php \Drupal\Tests\options\Kernel\Views\OptionsTestBase::setUp()

Overrides ViewsKernelTestBase::setUp

1 call to OptionsTestBase::setUp()
ViewsDataTest::setUp in core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php
1 method overrides OptionsTestBase::setUp()
ViewsDataTest::setUp in core/modules/options/tests/src/Kernel/Views/ViewsDataTest.php

File

core/modules/options/tests/src/Kernel/Views/OptionsTestBase.php, line 54

Class

OptionsTestBase
Base class for options views tests.

Namespace

Drupal\Tests\options\Kernel\Views

Code

protected function setUp($import_test_views = TRUE) {
    parent::setUp();
    $this->mockStandardInstall();
    ViewTestData::createTestViews(static::class, [
        '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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.