Completed
Push — address-as-title ( 9b6eeb...601934 )
by Peter
11:07
created

LocationTest::latLongValueProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace Maps\Tests\Elements;
4
5
use DataValues\Geo\Values\LatLongValue;
6
use Maps\Elements\Location;
7
8
/**
9
 * @covers Maps\Elements\Location
10
 *
11
 * @since 3.0
12
 *
13
 * @licence GNU GPL v2+
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class LocationTest extends \PHPUnit_Framework_TestCase {
17
18
	public function latLongValueProvider() {
19
		$argLists = [];
20
21
		$argLists[] = [ new LatLongValue( 0, 0 ) ];
22
		$argLists[] = [ new LatLongValue( 4, 2 ) ];
23
		$argLists[] = [ new LatLongValue( 42, 42 ) ];
24
		$argLists[] = [ new LatLongValue( -4.2, -42 ) ];
25
26
		return $argLists;
27
	}
28
29
	/**
30
	 * @dataProvider latLongValueProvider
31
	 */
32
	public function testGivenLatLongInConstructor_getCoordinatesReturnsIt( LatLongValue $latLong ) {
33
		$location = new Location( $latLong );
34
		$this->assertTrue( $latLong->equals( $location->getCoordinates() ) );
35
	}
36
37
}
38