Completed
Push — address-as-title ( feca68...38b79f )
by Peter
04:24
created

DisplayMapTest::processingProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 14

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 1
Metric Value
cc 1
eloc 14
c 3
b 1
f 1
nc 1
nop 0
dl 0
loc 21
rs 9.3142
1
<?php
2
3
namespace Maps\Test;
4
5
use Maps\Elements\Location;
6
7
/**
8
 * @covers MapsDisplayMap
9
 *
10
 * @group Maps
11
 * @group ParserHook
12
 * @group DisplayMapTest
13
 *
14
 * @licence GNU GPL v2+
15
 * @author Jeroen De Dauw < [email protected] >
16
 */
17
class DisplayMapTest extends ParserHookTest {
18
19
	/**
20
	 * @see ParserHookTest::getInstance
21
	 * @since 2.0
22
	 * @return \ParserHook
23
	 */
24
	protected function getInstance() {
25
		return new \MapsDisplayMap();
26
	}
27
28
	/**
29
	 * @see ParserHookTest::parametersProvider
30
	 * @since 2.0
31
	 * @return array
32
	 */
33
	public function parametersProvider() {
34
		$paramLists = [];
35
36
		// TODO
37
		$paramLists[] = [ 'coordinates' => '4,2' ];
38
39
		$paramLists[] = [ 'location' => '4,2' ];
40
41
		$paramLists[] = [ 'location' => 'new york city' ];
42
43
		$paramLists[] = [
44
			'service' => 'googlemaps',
45
			'location' => 'new york city',
46
			'zoom' => '10',
47
			'minzoom' => '5',
48
			'maxzoom' => '7',
49
			'autozoom' => 'off',
50
		];
51
52
		return $this->arrayWrap( $paramLists );
53
	}
54
55
	public function testForSomeReasonPhpSegfaultsIfThereIsOneMethodLess() {
56
		$this->assertTrue( (bool)'This is fucking weird' );
57
	}
58
59
	/**
60
	 * @see ParserHookTest::processingProvider
61
	 * @since 3.0
62
	 * @return array
63
	 */
64
	public function processingProvider() {
65
		$argLists = [];
66
67
		$values = [
68
			'locations' => '4,2',
69
			'width' => '420',
70
			'height' => '420',
71
			'service' => 'openlayers',
72
		];
73
74
		$expected = [
75
			'coordinates' => [ Location::newTitledFromLatLon( 4, 2 ) ],
76
			'width' => '420px',
77
			'height' => '420px',
78
			'mappingservice' => 'openlayers',
79
		];
80
81
		$argLists[] = [ $values, $expected ];
82
83
		return $argLists;
84
	}
85
86
}