You are here

protected function DrupalSolrMatchTestCase::buildDocument in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::buildDocument()
  2. 6.3 tests/solr_index_and_search.test \DrupalSolrMatchTestCase::buildDocument()
1 call to DrupalSolrMatchTestCase::buildDocument()
DrupalSolrMatchTestCase::populateIndex in tests/solr_index_and_search.test
Set up a small index of items to test against.

File

tests/solr_index_and_search.test, line 221

Class

DrupalSolrMatchTestCase

Code

protected function buildDocument($values = array()) {
  $document = new ApacheSolrDocument();
  if (!isset($values['entity_type'])) {
    $values['entity_type'] = 'fake.';
  }
  $document->id = apachesolr_document_id($values['entity_id'], $values['entity_type']);
  foreach ($values as $key => $value) {
    $document->{$key} = $value;
  }
  return $document;
}