function DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironmentURLs in Apache Solr Search 6.3
Same name and namespace in other branches
- 8 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironmentURLs()
- 7 tests/apachesolr_base.test \DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironmentURLs()
Asserts that we can use various url forms for the search environment
File
- tests/
apachesolr_base.test, line 160 - 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 testEditSearchEnvironmentURLs() {
// Set the various url schemes that will be tested
$urls = array(
'http://user@localhost:8983/solr/core_does_not_exists',
'http://user:pass@localhost:8983/solr/core_does_not_exists',
'http://user:pass@localhost/solr/core_does_not_exists',
'https://localhost:8983/solr/core_does_not_exists',
);
$this
->drupalLogin($this->admin_user);
foreach ($urls as $url) {
$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(
'url' => $url,
);
$this
->drupalPost($this
->getUrl(), $edit, t('Save'));
$this
->assertResponse(200);
apachesolr_load_all_environments(TRUE);
$this
->drupalGet('admin/settings/apachesolr/settings');
$this
->assertText($url, t('Search environment url was successfully set to !url', array(
'!url' => $url,
)));
}
}