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

LocationTest::latLongValueProvider()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.9332
c 0
b 0
f 0
cc 1
nc 1
nop 0
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