Completed
Push — dvtest ( a10768 )
by Jeroen De
05:04
created

WmsOverlayParserTest::getInstance()   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
c 1
b 1
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
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
	 * @see ValueParserTestBase::validInputProvider
17
	 *
18
	 * @return array
19
	 */
20
	public function validInputProvider() {
21
		$argLists = array();
22
23
		$valid = array(
24
			"http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi? Foundation.GTOPO30" =>
25
				array( "http://demo.cubewerx.com/demo/cubeserv/cubeserv.cgi?", "Foundation.GTOPO30" ),
26
			"http://maps.imr.no:80/geoserver/wms? vulnerable_areas:Identified_coral_area coral_identified_areas" =>
27
				array( "http://maps.imr.no:80/geoserver/wms?", "vulnerable_areas:Identified_coral_area", "coral_identified_areas" )
28
		);
29
30
		foreach ( $valid as $value => $expected ) {
31
			$expectedOverlay = new WmsOverlay( $expected[0], $expected[1] );
32
33
			if ( count( $expected ) == 3 ) {
34
				$expectedOverlay->setWmsStyleName( $expected[2] );
35
			}
36
37
			$argLists[] = array( (string)$value, $expectedOverlay );
38
		}
39
40
		return $argLists;
41
	}
42
43
	/**
44
	 * @see ValueParserTestBase::requireDataValue
45
	 *
46
	 * @return boolean
47
	 */
48
	protected function requireDataValue() {
49
		return false;
50
	}
51
52
	protected function getInstance() {
53
		return new WmsOverlayParser();
54
	}
55
56
}
57