public static function Solr36TestConnector::adjustBackendConfig in Search API Solr 4.x
8 calls to Solr36TestConnector::adjustBackendConfig()
- AddHierarchyTest::enableSolrServer in modules/
search_api_solr_legacy/ tests/ src/ Kernel/ Processor/ AddHierarchyTest.php - Swap the DB backend for a Solr backend.
- ContentAccessTest::enableSolrServer in modules/
search_api_solr_legacy/ tests/ src/ Kernel/ Processor/ ContentAccessTest.php - Swap the DB backend for a Solr backend.
- FacetsTest::setUp in modules/
search_api_solr_legacy/ tests/ src/ Functional/ FacetsTest.php - HtmlFilterTest::enableSolrServer in modules/
search_api_solr_legacy/ tests/ src/ Kernel/ Processor/ HtmlFilterTest.php - Swap the DB backend for a Solr backend.
- IntegrationTest::setUp in modules/
search_api_solr_legacy/ tests/ src/ Functional/ IntegrationTest.php
File
- modules/
search_api_solr_legacy/ tests/ modules/ search_api_solr_legacy_test/ src/ Plugin/ SolrConnector/ Solr36TestConnector.php, line 100
Class
- Solr36TestConnector
- Solr 36 test connector.
Namespace
Drupal\search_api_solr_legacy_test\Plugin\SolrConnectorCode
public static function adjustBackendConfig($config_name) {
$config_factory = \Drupal::configFactory();
$config = $config_factory
->getEditable($config_name);
$backend_config = $config
->get('backend_config');
unset($backend_config['connector_config']['username']);
unset($backend_config['connector_config']['password']);
$config
->set('backend_config', [
'connector' => 'solr_36_test',
'connector_config' => [
'scheme' => 'http',
'host' => 'localhost',
'port' => 8983,
'path' => '/',
'core' => '.',
] + $backend_config['connector_config'],
] + $backend_config)
->save(TRUE);
$search_api_server_storage = \Drupal::entityTypeManager()
->getStorage('search_api_server');
$search_api_server_storage
->resetCache();
$search_api_index_storage = \Drupal::entityTypeManager()
->getStorage('search_api_index');
$search_api_index_storage
->resetCache();
}