function DrupalSolrOfflineSearchPagesWebTestCase::setUp in Apache Solr Search 8
Same name and namespace in other branches
- 6.3 tests/apachesolr_base.test \DrupalSolrOfflineSearchPagesWebTestCase::setUp()
- 7 tests/apachesolr_base.test \DrupalSolrOfflineSearchPagesWebTestCase::setUp()
Implementation of setUp().
File
- tests/
apachesolr_base.test, line 259 - Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server
Class
- DrupalSolrOfflineSearchPagesWebTestCase
- @file Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server
Code
function setUp() {
parent::setUp('apachesolr', 'apachesolr_search', 'search', 'apachesolr_test');
// Create a basic user, which is subject to moderation.
$permissions = array(
'access content',
'search content',
);
$basic_user = $this
->drupalCreateUser($permissions);
// Create an admin user that can bypass revision moderation.
$permissions = array(
'access content',
'search content',
'administer nodes',
'administer search',
);
$admin_user = $this
->drupalCreateUser($permissions);
// Assign users to their test suite-wide properties.
$this->basic_user = $basic_user;
$this->admin_user = $admin_user;
// Make sure our environment does not exists
$env_id = apachesolr_default_environment(NULL, TRUE);
$environment = apachesolr_environment_load($env_id, TRUE);
$environment['url'] = 'http://localhost/solr/core_that_should_not_exist';
apachesolr_environment_save($environment);
// Reset all caches
apachesolr_load_all_environments(TRUE);
}