You are here

function DrupalSolrMatchTestCase::testMatching in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::testMatching()
  2. 6.3 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::testMatching()
  3. 6 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::testMatching()
  4. 6.2 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::testMatching()

Test search indexing.

File

tests/solr_index_and_search.test, line 194

Class

DrupalSolrMatchTestCase

Code

function testMatching() {
  if ($this->solr_available) {

    // workaround for drupal.org test bot
    $this
      ->assertTrue($this->solr
      ->ping(), "The Server could be Pinged");
    $response = $this->solr
      ->search("*:*", array());
    $response = $response->response;
    $this
      ->assertEqual($response->numFound, 0, "There should not be any documents in the index");
    $this
      ->populateIndex(7);
    $response = $this->solr
      ->search("*:*", array());
    $response = $response->response;
    $this
      ->assertEqual($response->numFound, 7, "There should be 7 documents in the index");
    $this
      ->_testQueries();
  }
}