Completed
Push — master ( 81538e...c2bf57 )
by Jeroen De
10:06
created

LocationTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A latLongValueProvider() 0 10 1
A testGivenLatLongInConstructor_getCoordinatesReturnsIt() 0 4 1
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace Maps\Tests\Unit\LegacyModel;
6
7
use DataValues\Geo\Values\LatLongValue;
8
use Maps\LegacyModel\Location;
9
use PHPUnit\Framework\TestCase;
10
11
/**
12
 * @covers \Maps\LegacyModel\Location
13
 *
14
 * @licence GNU GPL v2+
15
 * @author Jeroen De Dauw < [email protected] >
16
 */
17
class LocationTest extends TestCase {
18
19
	public function latLongValueProvider() {
20
		$argLists = [];
21
22
		$argLists[] = [ new LatLongValue( 0, 0 ) ];
23
		$argLists[] = [ new LatLongValue( 4, 2 ) ];
24
		$argLists[] = [ new LatLongValue( 42, 42 ) ];
25
		$argLists[] = [ new LatLongValue( -4.2, -42 ) ];
26
27
		return $argLists;
28
	}
29
30
	/**
31
	 * @dataProvider latLongValueProvider
32
	 */
33
	public function testGivenLatLongInConstructor_getCoordinatesReturnsIt( LatLongValue $latLong ) {
34
		$location = new Location( $latLong );
35
		$this->assertTrue( $latLong->equals( $location->getCoordinates() ) );
36
	}
37
38
}
39