function SearchSetLocaleTest::setUp

Same name and namespace in other branches
  1. 7.x modules/search/search.test \SearchSetLocaleTest::setUp()
  2. 8.9.x core/modules/search/tests/src/Functional/SearchSetLocaleTest.php \Drupal\Tests\search\Functional\SearchSetLocaleTest::setUp()
  3. 10 core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php \Drupal\Tests\search\Kernel\SearchSetLocaleTest::setUp()
  4. 11.x core/modules/search/tests/src/Kernel/SearchSetLocaleTest.php \Drupal\Tests\search\Kernel\SearchSetLocaleTest::setUp()

Overrides BrowserTestBase::setUp

File

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

Class

SearchSetLocaleTest
Tests that search works with numeric locale settings.

Namespace

Drupal\Tests\search\Functional

Code

protected function setUp() : void {
    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();
}

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