protected function SearchPageCacheTagsTest::setUp in Drupal 9
Same name and namespace in other branches
- 8 core/modules/search/tests/src/Functional/SearchPageCacheTagsTest.php \Drupal\Tests\search\Functional\SearchPageCacheTagsTest::setUp()
Overrides BrowserTestBase::setUp
File
- core/
modules/ search/ tests/ src/ Functional/ SearchPageCacheTagsTest.php, line 50
Class
- SearchPageCacheTagsTest
- Tests the search_page entity cache tags on the search results pages.
Namespace
Drupal\Tests\search\FunctionalCode
protected function setUp() : void {
parent::setUp();
$this
->drupalCreateContentType([
'type' => 'page',
'name' => 'Basic page',
]);
// Create user.
$this->searchingUser = $this
->drupalCreateUser([
'search content',
'access user profiles',
]);
// Create a node and update the search index.
$this->node = $this
->drupalCreateNode([
'title' => 'bike shed shop',
]);
$this->node
->setOwner($this->searchingUser);
$this->node
->save();
$this->container
->get('plugin.manager.search')
->createInstance('node_search')
->updateIndex();
}