You are here

public function SearchApiSolrLocationTest::insertExampleContent in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 tests/src/Kernel/SearchApiSolrLocationTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrLocationTest::insertExampleContent()
  2. 8 tests/src/Kernel/SearchApiSolrLocationTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrLocationTest::insertExampleContent()
  3. 8.2 tests/src/Kernel/SearchApiSolrLocationTest.php \Drupal\Tests\search_api_solr\Kernel\SearchApiSolrLocationTest::insertExampleContent()
1 call to SearchApiSolrLocationTest::insertExampleContent()
SearchApiSolrLocationTest::commonSolrBackendSetUp in tests/src/Kernel/SearchApiSolrLocationTest.php
Required parts of the setUp() function that are the same for all backends.

File

tests/src/Kernel/SearchApiSolrLocationTest.php, line 90

Class

SearchApiSolrLocationTest
Tests location searches and distance facets using the Solr search backend.

Namespace

Drupal\Tests\search_api_solr\Kernel

Code

public function insertExampleContent() {
  $this
    ->addTestEntity(1, [
    'name' => 'London',
    'body' => 'London',
    'type' => 'item',
    'location' => 'POINT(-0.076132 51.508530)',
  ]);
  $this
    ->addTestEntity(2, [
    'name' => 'New York',
    'body' => 'New York',
    'type' => 'item',
    'location' => 'POINT(-73.138260 40.792240)',
  ]);
  $this
    ->addTestEntity(3, [
    'name' => 'Brussels',
    'body' => 'Brussels',
    'type' => 'item',
    'location' => 'POINT(4.355607 50.878899)',
  ]);
  $count = \Drupal::entityQuery('entity_test_mulrev_changed')
    ->count()
    ->execute();
  $this
    ->assertEquals(3, $count, "{$count} items inserted.");
}