Skip to content

Instantly share code, notes, and snippets.

@dbjpanda
Created July 13, 2017 09:22
Show Gist options
  • Save dbjpanda/5ebe0805e84b7ba076cd551a294f8650 to your computer and use it in GitHub Desktop.
Save dbjpanda/5ebe0805e84b7ba076cd551a294f8650 to your computer and use it in GitHub Desktop.
<?php
namespace Drupal\Tests\search_api_location\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\search_api_location\Plugin\search_api_location\location_input\Geocode;
/**
* Test for the geocode plugin.
*
* @group search_api_location
*/
class GeocodeTest extends KernelTestBase {
/**
* Modules to enable for this test.
*
* @var string[]
*/
public static $modules = [
'user',
'search_api',
'search_api_location',
'geocoder'
];
/**
* Test the parsed input entered by user in text format.
*/
public function testGetParsedInput() {
$sut = $this->container
->get('plugin.manager.search_api_location.location_input')
->createInstance('geocode');
$input['value']="Delhi";
$this->assertEquals($sut->getParsedInput($input), '28.704059,77.10249');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment