You are here

public function GeocodeTest::testGetParsedInput in Search API Location 8

Test the parsing of input entered by user in text format.

@covers ::getParsedInput

File

modules/search_api_location_geocoder/tests/src/Kernel/GeocodeTest.php, line 80

Class

GeocodeTest
Test for the geocode plugin.

Namespace

Drupal\Tests\search_api_location_geocoder\Kernel

Code

public function testGetParsedInput() {
  $input['value'] = 'Ghent';
  $parsed = $this->sut
    ->getParsedInput($input);
  list($lat, $lng) = explode(',', $parsed);
  $this
    ->assertEquals(round($lat, 0, PHP_ROUND_HALF_DOWN), 51);
  $this
    ->assertEquals(round($lng, 0, PHP_ROUND_HALF_DOWN), 4);
}