You are here

protected function SearchSetLocaleTest::setUp in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/search/tests/src/Functional/SearchSetLocaleTest.php, line 31

Class

SearchSetLocaleTest
Tests that search works with numeric locale settings.

Namespace

Drupal\Tests\search\Functional

Code

protected function setUp() {
  parent::setUp();
  $this
    ->drupalCreateContentType([
    'type' => 'page',
    'name' => 'Basic page',
  ]);

  // Create a plugin instance.
  $this->nodeSearchPlugin = $this->container
    ->get('plugin.manager.search')
    ->createInstance('node_search');

  // Create a node with a very simple body.
  $this
    ->drupalCreateNode([
    'body' => [
      [
        'value' => 'tapir',
      ],
    ],
  ]);

  // Update the search index.
  $this->nodeSearchPlugin
    ->updateIndex();
}