You are here

protected function AbstractDrupalSolrOnlineWebTestCase::coreAdmin in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 tests/solr_index_and_search.test \AbstractDrupalSolrOnlineWebTestCase::coreAdmin()
  2. 6.3 tests/solr_index_and_search.test \AbstractDrupalSolrOnlineWebTestCase::coreAdmin()

Helper function to invoke core admin actions.

4 calls to AbstractDrupalSolrOnlineWebTestCase::coreAdmin()
AbstractDrupalSolrOnlineWebTestCase::checkCoreStatus in tests/solr_index_and_search.test
Helper function to verify that the expected core exists.
AbstractDrupalSolrOnlineWebTestCase::getSolrVersion in tests/solr_index_and_search.test
AbstractDrupalSolrOnlineWebTestCase::setUpSolr in tests/solr_index_and_search.test
AbstractDrupalSolrOnlineWebTestCase::tearDown in tests/solr_index_and_search.test
Delete created files and temporary files directory, delete the tables created by setUp(), and reset the database prefix.

File

tests/solr_index_and_search.test, line 128

Class

AbstractDrupalSolrOnlineWebTestCase

Code

protected function coreAdmin($action, $query = array()) {
  $query['action'] = $action;
  $query['wt'] = 'json';
  $url = url($this->core_admin_url, array(
    'query' => $query,
  ));
  $options['timeout'] = 2;
  $result = drupal_http_request($url, $options);
  if ($result->code == 200) {
    return json_decode($result->data, TRUE);
  }
  else {
    return FALSE;
  }
}