for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Maps\Test;
/**
* @covers Maps\DistanceParser
* @licence GNU GPL v2+
* @author Jeroen De Dauw < [email protected] >
*/
class DistanceParserTest extends \ValueParsers\Test\StringValueParserTest {
getInstance
* @see ValueParserTestBase::validInputProvider
*
* @since 3.0
* @return array
public function validInputProvider() {
$argLists = array();
$valid = array(
'1' => 1,
'1m' => 1,
'42 km' => 42000,
'4.2 km' => 4200,
'4.2 m' => 4.2,
);
foreach ( $valid as $value => $expected ) {
$argLists[] = array( (string)$value, $expected );
}
return $argLists;
* @see ValueParserTestBase::getParserClass
* @return string
protected function getParserClass() {
return 'Maps\DistanceParser';
* @see ValueParserTestBase::requireDataValue
* @return boolean
protected function requireDataValue() {
return false;