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

LocationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 0
loc 22
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A latLongValueProvider() 0 10 1
A testGivenLatLongInConstructor_getCoordinatesReturnsIt() 0 4 1
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