Completed
Push — address-as-title ( 601934...feca68 )
by Peter
09:00
created

WmsOverlayParserTest::getParserClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
eloc 2
c 1
b 1
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Maps\Test;
4
5
use Maps\Elements\WmsOverlay;
6
use Maps\WmsOverlayParser;
7
8
/**
9
 * @covers Maps\WmsOverlayParser
10
 * @licence GNU GPL v2+
11
 * @author Mathias Mølster Lidal <[email protected]>
12
 */
13
class WmsOverlayParserTest extends \ValueParsers\Test\StringValueParserTest {
14
15
	/**
16
	 * @return string
17
	 */
18
	protected function getParserClass() {
19
		return WmsOverlayParser::class;
20
	}
21
22
	/**
23
	 * @see ValueParserTestBase::validInputProvider
24
	 *
25
	 * @return array
26
	 */
27
	public function validInputProvider() {
28
		$argLists = [];
29
30
		$valid = [
31
			"http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi? Foundation.GTOPO30" =>
32
				[ "http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?", "Foundation.GTOPO30" ],
33
			"http://maps.imr.no:80/geoserver/wms? vulnerable_areas:Identified_coral_area coral_identified_areas" =>
34
				[ "http://maps.imr.no:80/geoserver/wms?", "vulnerable_areas:Identified_coral_area", "coral_identified_areas" ]
35
		];
36
37
		foreach ( $valid as $value => $expected ) {
38
			$expectedOverlay = new WmsOverlay( $expected[0], $expected[1] );
39
40
			if ( count( $expected ) == 3 ) {
41
				$expectedOverlay->setWmsStyleName( $expected[2] );
42
			}
43
44
			$argLists[] = [ (string)$value, $expectedOverlay ];
45
		}
46
47
		return $argLists;
48
	}
49
50
	/**
51
	 * @see ValueParserTestBase::requireDataValue
52
	 *
53
	 * @return boolean
54
	 */
55
	protected function requireDataValue() {
56
		return false;
57
	}
58
59
	protected function getInstance() {
60
		return new WmsOverlayParser();
61
	}
62
63
}
64