protected function setUp() { parent::setUp(); // Log in as a user that can create and search content. $this->searchUser = $this->drupalCreateUser(array('search content', 'administer search')); $this->drupalLogin($this->searchUser); }
protected function setUp() { parent::setUp(); // Create a test user and log in. $this->testUser = $this->drupalCreateUser(array('access content', 'search content')); $this->drupalLogin($this->testUser); }
protected function setUp() { parent::setUp(); // Create and login user. $admin_user = $this->drupalCreateUser(array('administer blocks', 'search content')); $this->drupalLogin($admin_user); }
function setUp() { parent::setUp(); // Create searching user. $this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval')); // Login with sufficient privileges. $this->drupalLogin($this->searching_user); }
protected function setUp() { parent::setUp(); node_access_rebuild(); // Create a test user and log in. $this->testUser = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search', 'access user profiles')); $this->drupalLogin($this->testUser); }
/** * {@inheritdoc} */ protected function setUp() { parent::setUp(); // Create user. $this->searchingUser = $this->drupalCreateUser(array('search content', 'access user profiles')); // Create a node and update the search index. $this->node = $this->drupalCreateNode(['title' => 'bike shed shop']); $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); search_update_totals(); }
protected function setUp() { parent::setUp(); // 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(array('body' => array(array('value' => 'tapir')))); // Update the search index. $this->nodeSearchPlugin->updateIndex(); search_update_totals(); }
function setUp() { parent::setUp(); // Create a user and a node, and update the search index. $test_user = $this->drupalCreateUser(array('access content', 'search content', 'administer nodes')); $this->drupalLogin($test_user); $this->node = $this->drupalCreateNode(); $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); search_update_totals(); // Set up a dummy initial count of times the form has been submitted. $this->submit_count = \Drupal::state()->get('search_embedded_form.submit_count'); $this->refreshVariables(); }
protected function setUp() { parent::setUp(); // Create and login user. $test_user = $this->drupalCreateUser(array('access content', 'search content', 'use advanced search', 'administer nodes')); $this->drupalLogin($test_user); // Create initial node. $this->node = $this->drupalCreateNode(); // First update the index. This does the initial processing. $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); // Then, run the shutdown function. Testing is a unique case where indexing // and searching has to happen in the same request, so running the shutdown // function manually is needed to finish the indexing process. search_update_totals(); }
function setUp() { parent::setUp(); // Login as a user that can create and search content. $this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports')); $this->drupalLogin($this->search_user); // Add a single piece of content and index it. $node = $this->drupalCreateNode(); $this->search_node = $node; // Link the node to itself to test that it's only indexed once. The content // also needs the word "pizza" so we can use it as the search keyword. $body_key = 'body[0][value]'; $edit[$body_key] = l($node->label(), 'node/' . $node->id()) . ' pizza sandwich'; $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save and keep published')); $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); search_update_totals(); // Enable the search block. $this->drupalPlaceBlock('search_form_block'); }
function setUp() { parent::setUp(); // Create user. $this->searching_user = $this->drupalCreateUser(array('search content', 'access user profiles')); }
function setUp() { parent::setUp(); $web_user = $this->drupalCreateUser(array('create page content', 'edit own page content', 'search content', 'use advanced search')); $this->drupalLogin($web_user); }