function SearchRankingTest::setUp

Same name in this branch
  1. 11.x core/modules/statistics/tests/src/Functional/search/SearchRankingTest.php \Drupal\Tests\statistics\Functional\search\SearchRankingTest::setUp()
Same name and namespace in other branches
  1. 9 core/modules/search/tests/src/Functional/SearchRankingTest.php \Drupal\Tests\search\Functional\SearchRankingTest::setUp()
  2. 8.9.x core/modules/search/tests/src/Functional/SearchRankingTest.php \Drupal\Tests\search\Functional\SearchRankingTest::setUp()
  3. 10 core/modules/search/tests/src/Functional/SearchRankingTest.php \Drupal\Tests\search\Functional\SearchRankingTest::setUp()
  4. 10 core/modules/statistics/tests/src/Functional/search/SearchRankingTest.php \Drupal\Tests\statistics\Functional\search\SearchRankingTest::setUp()

Overrides BrowserTestBase::setUp

File

core/modules/search/tests/src/Functional/SearchRankingTest.php, line 47

Class

SearchRankingTest
Indexes content and tests ranking factors.

Namespace

Drupal\Tests\search\Functional

Code

protected function setUp() : void {
    parent::setUp();
    $this->drupalCreateContentType([
        'type' => 'page',
        'name' => 'Basic page',
    ]);
    // Create a plugin instance.
    $this->nodeSearch = SearchPage::load('node_search');
    // Log in with sufficient privileges.
    $this->drupalLogin($this->drupalCreateUser([
        'post comments',
        'skip comment approval',
        'create page content',
        'administer search',
    ]));
}

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