You are here

public function ApacheSolrRealTimeTest::setUp in Apache Solr Real-Time 7

Set up test by installing modules and defining Solr environment.

Overrides DrupalWebTestCase::setUp

File

tests/apachesolr_realtime.test, line 26
Test cases for apachesolr_realtime module.

Class

ApacheSolrRealTimeTest
@file Test cases for apachesolr_realtime module.

Code

public function setUp() {

  // Install our module.
  parent::setUp('apachesolr', 'apachesolr_realtime');

  // Set default solr server variables.
  $environment = array(
    'env_id' => 'solr',
    'name' => 'localhost server',
    'url' => 'http://localhost:8983/solr/test',
    'server_class' => '',
  );

  // Set the Solr environment.
  variable_set('apachesolr_default_environment', $environment['env_id']);
  apachesolr_environment_save($environment);

  // Create and login user.
  $account = $this
    ->drupalCreateUser(array(
    'access content',
    'administer content types',
  ));
  $this
    ->drupalLogin($account);
}