You are here

function DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironment in Apache Solr Search 8

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

Asserts that we can edit a search environment

File

tests/apachesolr_base.test, line 138
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 testEditSearchEnvironment() {
  $this
    ->drupalLogin($this->admin_user);
  $this
    ->drupalGet('admin/config/search/apachesolr/settings');
  $this
    ->clickLink(t('Edit'));
  $this
    ->assertText(t('Example: http://localhost:8983/solr'), t('Edit page was succesfully loaded'));
  $edit = array(
    'name' => 'new description foo bar',
    'url' => 'http://localhost:8983/solr/core_does_not_exists',
  );
  $this
    ->drupalPost($this
    ->getUrl(), $edit, t('Save'));
  $this
    ->assertResponse(200);
  $this
    ->drupalGet('admin/config/search/apachesolr/settings');
  $this
    ->assertText(t('new description foo bar'), t('Search environment description was succesfully edited'));
  $this
    ->assertText('http://localhost:8983/solr/core_does_not_exists', t('Search environment url was succesfully edited'));
}