function DrupalSolrOfflineEnvironmentWebTestCase::testEditSearchEnvironmentURLs in Apache Solr Search 8
Same name and namespace in other branches
- 6.3 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 154 - 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/config/search/apachesolr/settings');
$this
->clickLink(t('Edit'));
$this
->assertText(t('Example: http://localhost:8983/solr'), t('Edit page was succesfully loaded'));
$edit = array(
'url' => $url,
);
$this
->drupalPost($this
->getUrl(), $edit, t('Save'));
$this
->assertResponse(200);
$this
->drupalGet('admin/config/search/apachesolr/settings');
$this
->assertText($url, t('Search environment url was succesfully set to !url', array(
'!url' => $url,
)));
}
}