You are here

function DrupalSolrOfflineEnvironmentWebTestCase::testIndexFileIncluded in Apache Solr Search 6.3

Same name and namespace in other branches
  1. 8 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testIndexFileIncluded()
  2. 7 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testIndexFileIncluded()

Asserts that the module was installed and that a notice appears that the server is offline

File

tests/apachesolr_base.test, line 108
Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server

Class

DrupalSolrOfflineEnvironmentWebTestCase
@file Unit test class that provides tests for base functionality of the Apachesolr Module without having the need of a Solr Server

Code

function testIndexFileIncluded() {
  $env_id = apachesolr_default_environment();
  $environment = apachesolr_environment_load($env_id);
  $environment['url'] = 'http://localhost/solr/core_that_should_not_exist';
  apachesolr_environment_save($environment);
  cache_clear_all('apachesolr:environments', 'cache_apachesolr');
  $paths = array(
    'user',
    'node',
    'admin/settings/apachesolr',
    'admin/settings/apachesolr/search-pages',
    'admin/settings/apachesolr/search-pages/core_search/edit',
    'admin/structure/block/manage/apachesolr_search/mlt-001/configure',
    'admin/settings/apachesolr/settings/solr/bias',
    'admin/settings/apachesolr/settings/solr/index',
    'admin/settings/apachesolr/settings/solr/edit',
    'admin/reports/apachesolr',
    'admin/reports/apachesolr/conf',
    'search/site',
  );
  $this
    ->drupalLogin($this->admin_user);
  foreach ($paths as $path) {
    $this
      ->drupalGet($path);
    $text = 'apachesolr.index.inc was included';
    $this
      ->assertNoText($text, t('Apachesolr.index.inc was not included'));
  }
}