function DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironment in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironment()
- 7 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironment()
Asserts that we can edit a search environment
File
- tests/
apachesolr_base.test, line 140 - 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/settings/apachesolr/settings');
$this
->clickLink(t('Edit'));
$this
->assertText(t('Example: http://localhost:8983/solr'), t('Edit page was successfully 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);
apachesolr_load_all_environments(TRUE);
$environments = NULL;
$solr_cache = NULL;
$this
->drupalGet('admin/settings/apachesolr/settings');
$this
->assertText(t('new description foo bar'), t('Search environment description was successfully edited'));
$this
->assertText('http://localhost:8983/solr/core_does_not_exists', t('Search environment url was successfully edited'));
}