Completed
Pull Request — master (#130)
by None
07:05
created

testGivenInvalidInput_exceptionIsThrown()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 6
rs 9.4285
cc 1
eloc 4
nc 1
nop 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A DistanceParserTest::getParserClass() 0 3 1
1
<?php
2
3
namespace Maps\Test;
4
5
/**
6
 * @covers Maps\DistanceParser
7
 * @licence GNU GPL v2+
8
 * @author Jeroen De Dauw < [email protected] >
9
 */
10
class DistanceParserTest extends \ValueParsers\Test\StringValueParserTest {
0 ignored issues
show
Bug introduced by
There is one abstract method getInstance in this class; you could implement it, or declare this class as abstract.
Loading history...
11
12
	/**
13
	 * @see ValueParserTestBase::validInputProvider
14
	 *
15
	 * @since 3.0
16
	 *
17
	 * @return array
18
	 */
19
	public function validInputProvider() {
20
		$argLists = array();
21
22
		$valid = array(
23
			'1' => 1,
24
			'1m' => 1,
25
			'42 km' => 42000,
26
			'4.2 km' => 4200,
27
			'4.2 m' => 4.2,
28
		);
29
30
		foreach ( $valid as $value => $expected ) {
31
			$argLists[] = array( (string)$value, $expected );
32
		}
33
34
		return $argLists;
35
	}
36
37
	/**
38
	 * @see ValueParserTestBase::getParserClass
39
	 *
40
	 * @since 3.0
41
	 *
42
	 * @return string
43
	 */
44
	protected function getParserClass() {
45
		return 'Maps\DistanceParser';
46
	}
47
48
	/**
49
	 * @see ValueParserTestBase::requireDataValue
50
	 *
51
	 * @since 3.0
52
	 *
53
	 * @return boolean
54
	 */
55
	protected function requireDataValue() {
56
		return false;
57
	}
58
59
}
60