class IntegrationTest in Search API Solr 4.x
Same name in this branch
- 4.x tests/src/Functional/IntegrationTest.php \Drupal\Tests\search_api_solr\Functional\IntegrationTest
- 4.x modules/search_api_solr_legacy/tests/src/Functional/IntegrationTest.php \Drupal\Tests\search_api_solr_legacy\Functional\IntegrationTest
- 4.x modules/search_api_solr_defaults/tests/src/Functional/IntegrationTest.php \Drupal\Tests\search_api_solr_defaults\Functional\IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.
@group search_api_solr_legacy
Hierarchy
- class \Drupal\Tests\search_api_solr\Functional\IntegrationTest extends \Drupal\Tests\search_api\Functional\IntegrationTest uses SolrCommitTrait
- class \Drupal\Tests\search_api_solr_legacy\Functional\IntegrationTest
Expanded class hierarchy of IntegrationTest
File
- modules/
search_api_solr_legacy/ tests/ src/ Functional/ IntegrationTest.php, line 13
Namespace
Drupal\Tests\search_api_solr_legacy\FunctionalView source
class IntegrationTest extends SearchApiSolrIntegrationTest {
/**
* {@inheritdoc}
*/
public static $modules = [
'search_api_solr_legacy',
'search_api_solr_legacy_test',
];
/**
* {@inheritdoc}
*/
public function setUp() : void {
parent::setUp();
// Swap the connector.
Solr36TestConnector::adjustBackendConfig('search_api.server.solr_search_server');
}
/**
* {@inheritdoc}
*/
protected function configureBackendAndSave(array $edit) {
$this
->submitForm($edit, 'Save');
$this
->assertSession()
->pageTextContains('Please configure the selected backend.');
$edit += [
'backend_config[connector]' => 'solr_36',
];
$this
->submitForm($edit, 'Save');
$this
->assertSession()
->pageTextContains('Please configure the selected Solr connector.');
$edit += [
'backend_config[connector_config][host]' => 'dummy',
];
$this
->submitForm($edit, 'Save');
$this
->assertSession()
->pageTextContains('The server was successfully saved.');
$this
->assertSession()
->addressEquals('admin/config/search/search-api/server/' . $this->serverId);
$this
->assertSession()
->pageTextContains('The Solr server could not be reached or is protected by your service provider.');
// Go back in and configure Solr.
$edit_path = 'admin/config/search/search-api/server/' . $this->serverId . '/edit';
$this
->drupalGet($edit_path);
$edit['backend_config[connector_config][host]'] = 'localhost';
$this
->submitForm($edit, 'Save');
$this
->assertSession()
->pageTextContains('The Solr server could be reached.');
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
IntegrationTest:: |
public static | property |
Overrides IntegrationTest:: |
|
IntegrationTest:: |
protected | property | The backend of the search server used for this test. | |
IntegrationTest:: |
protected | function |
Overrides IntegrationTest:: |
|
IntegrationTest:: |
protected | function | Indexes all (unindexed) items on the specified index. | |
IntegrationTest:: |
public | function | ||
IntegrationTest:: |
protected | function | ||
IntegrationTest:: |
public | function | Tests various operations via the Search API's admin UI. | |
IntegrationTest:: |
public | function | This test doesn't really include any backend specific stuff and could be skipped. | |
SolrCommitTrait:: |
protected | function | Explicitly sends a commit command to a Solr server. |