You are here

public function GeolocationViewsProximityArgumentTest::testRoundingError in Geolocation Field 8

Same name and namespace in other branches
  1. 8.3 tests/src/Functional/GeolocationViewsProximityArgumentTest.php \Drupal\Tests\geolocation\Functional\GeolocationViewsProximityArgumentTest::testRoundingError()
  2. 8.2 tests/src/Functional/GeolocationViewsProximityArgumentTest.php \Drupal\Tests\geolocation\Functional\GeolocationViewsProximityArgumentTest::testRoundingError()

Tests to ensure rounding error doesn't occur (d.o #2796999).

File

tests/src/Functional/GeolocationViewsProximityArgumentTest.php, line 110

Class

GeolocationViewsProximityArgumentTest
Tests the grid style plugin.

Namespace

Drupal\Tests\geolocation\Functional

Code

public function testRoundingError() {
  $entity_test_storage = \Drupal::entityTypeManager()
    ->getStorage('node');
  $entity_test_storage
    ->create([
    'title' => 'Proximity 4',
    'body' => 'test test',
    'type' => 'geolocation_default_article',
    'field_geolocation_demo_single' => [
      'lat' => 51.4545,
      'lng' => -2.5879,
    ],
  ])
    ->save();
  $this
    ->drupalGet($this->viewsPath . '/51.4545,-2.5879<5miles');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->responseContains('Proximity 4');
}