You are here

public function GeolocationViewsProximityArgumentTest::testArgumentParse in Geolocation Field 8.3

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

Tests to ensure views argument is parsed correctly (d.o #2856948)

File

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

Class

GeolocationViewsProximityArgumentTest
Tests the grid style plugin.

Namespace

Drupal\Tests\geolocation\Functional

Code

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