for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Maps\Tests\Integration\MediaWiki\ParserHooks;
use DataValues\Geo\Values\LatLongValue;
use Jeroen\SimpleGeocoder\Geocoders\InMemoryGeocoder;
use Maps\MediaWiki\ParserHooks\GeocodeFunction;
/**
* @covers GeocodeFunction
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class GeocodeTest extends ParserHookTest {
* @see ParserHookTest::parametersProvider
public function parametersProvider() {
$paramLists = [];
$paramLists[] = [ 'location' => 'New York', '4, 2' ];
$paramLists[] = [ 'location' => 'Brussels', '2, 3' ];
$paramLists[] = [ 'location' => 'I am a tomato', 'Geocoding failed' ];
return $this->arrayWrap( $paramLists );
}
* @see ParserHookTest::processingProvider
public function processingProvider() {
$argLists = [];
$argLists[] = [
[
'location' => '4,2',
'directional' => 'yes',
],
'directional' => true,
]
];
return $argLists;
* @see ParserHookTest::getInstance
protected function getInstance() {
return new \Maps\MediaWiki\ParserHooks\GeocodeFunction(
new InMemoryGeocoder(
'New York' => new LatLongValue( 4, 2 ),
'Brussels' => new LatLongValue( 2, 3 ),
)
);