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

LineParserTest::validInputProvider()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 47
Code Lines 29

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 47
rs 9.0303
cc 3
eloc 29
nc 3
nop 0
1
<?php
2
3
namespace Maps\Test;
4
5
use DataValues\LatLongValue;
6
use Maps\Elements\Line;
7
8
/**
9
 * @covers Maps\LineParser
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class LineParserTest 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...
14
15
	/**
16
	 * @see ValueParserTestBase::validInputProvider
17
	 *
18
	 * @since 3.0
19
	 *
20
	 * @return array
21
	 */
22
	public function validInputProvider() {
23
		$argLists = array();
24
25
		$valid = array();
26
27
		$valid[] = array(
28
			array(
29
				42,
30
				4.2
31
			),
32
		);
33
34
		$valid[] = array(
35
			array(
36
				49.83798245308486,
37
				2.724609375
38
			),
39
			array(
40
				52.05249047600102,
41
				8.26171875
42
			),
43
			array(
44
				46.37725420510031,
45
				6.15234375
46
			),
47
			array(
48
				49.83798245308486,
49
				2.724609375
50
			),
51
		);
52
53
		foreach ( $valid as $values ) {
54
			$input = array();
55
			$output = array();
56
57
			foreach ( $values as $value ) {
58
				$input[] = implode( ',', $value );
59
				$output[] = new LatLongValue( $value[0], $value[1] );
60
			}
61
62
			$input = implode( ':', $input );
63
64
			$argLists[] = array( $input, new Line( $output ) );
65
		}
66
67
		return $argLists;
68
	}
69
70
	/**
71
	 * @see ValueParserTestBase::getParserClass
72
	 *
73
	 * @since 3.0
74
	 *
75
	 * @return string
76
	 */
77
	protected function getParserClass() {
78
		return 'Maps\LineParser';
79
	}
80
81
	/**
82
	 * @see ValueParserTestBase::requireDataValue
83
	 *
84
	 * @since 3.0
85
	 *
86
	 * @return boolean
87
	 */
88
	protected function requireDataValue() {
89
		return false;
90
	}
91
92
}
93