Completed
Push — master ( 684184...9a35aa )
by Jeroen De
08:07
created

GeocodeTest   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

Changes 0
Metric Value
dl 0
loc 48
rs 10
c 0
b 0
f 0
wmc 3
lcom 0
cbo 4

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 3 1
A parametersProvider() 0 7 1
A processingProvider() 0 17 1
1
<?php
2
3
namespace Maps\Test;
4
5
use Maps\Elements\Location;
6
7
/**
8
 * @covers MapsGeocode
9
 *
10
 * @group Maps
11
 * @group ParserHook
12
 *
13
 * @licence GNU GPL v2+
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class GeocodeTest extends ParserHookTest {
17
18
	/**
19
	 * @see ParserHookTest::getInstance
20
	 * @since 2.0
21
	 * @return \ParserHook
22
	 */
23
	protected function getInstance() {
24
		return new \MapsGeocode();
25
	}
26
27
	/**
28
	 * @see ParserHookTest::parametersProvider
29
	 * @since 2.0
30
	 * @return array
31
	 */
32
	public function parametersProvider() {
33
		$paramLists = [];
34
35
		$paramLists[] = [ 'location' => 'new york city' ];
36
37
		return $this->arrayWrap( $paramLists );
38
	}
39
40
	/**
41
	 * @see ParserHookTest::processingProvider
42
	 * @since 3.0
43
	 * @return array
44
	 */
45
	public function processingProvider() {
46
		$argLists = [];
47
48
		$values = [
49
			'location' => '4,2',
50
			'allowcoordinates' => 'yes',
51
		];
52
53
		$expected = [
54
			'location' => new Location( new \DataValues\LatLongValue( 4, 2 ) ),
0 ignored issues
show
Deprecated Code introduced by
The class DataValues\LatLongValue has been deprecated with message: since 1.0, use the base class instead.

This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.

Loading history...
55
			'allowcoordinates' => true,
56
		];
57
58
		$argLists[] = [ $values, $expected ];
59
60
		return $argLists;
61
	}
62
63
}