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 Maps\Elements\Location;
use Maps\MediaWiki\ParserHooks\GeoDistanceFunction;
/**
* @covers GeoDistanceFunction
*
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class GeodistanceTest extends ParserHookTest {
* @see ParserHookTest::parametersProvider
public function parametersProvider() {
$paramLists = [];
$paramLists[] = [
'location1' => '4,2',
'location2' => '42,0',
];
'4,2',
'42,0',
return $this->arrayWrap( $paramLists );
}
* @see ParserHookTest::processingProvider
* @since 3.0
* @return array
public function processingProvider() {
$argLists = [];
$values = [
$expected = [
'location1' => new Location( new LatLongValue( 4, 2 ) ),
'location2' => new Location( new LatLongValue( 42, 0 ) ),
$argLists[] = [ $values, $expected ];
'unit' => '~=[,,_,,]:3',
'decimals' => '1',
'decimals' => 1,
return $argLists;
* @see ParserHookTest::getInstance
protected function getInstance() {
return new \Maps\MediaWiki\ParserHooks\GeoDistanceFunction();