Completed
Push — MediaWikiFileUrlFinderTest ( d58bee )
by Jeroen De
03:36
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
namespace Maps\Tests\Unit\Elements;
4
5
use DataValues\Geo\Values\LatLongValue;
6
use Maps\Elements\Location;
7
use PHPUnit\Framework\TestCase;
8
9
/**
10
 * @covers \Maps\Elements\Location
11
 *
12
 * @licence GNU GPL v2+
13
 * @author Jeroen De Dauw < [email protected] >
14
 */
15
class LocationTest extends TestCase {
16
17
	public function latLongValueProvider() {
18
		$argLists = [];
19
20
		$argLists[] = [ new LatLongValue( 0, 0 ) ];
21
		$argLists[] = [ new LatLongValue( 4, 2 ) ];
22
		$argLists[] = [ new LatLongValue( 42, 42 ) ];
23
		$argLists[] = [ new LatLongValue( -4.2, -42 ) ];
24
25
		return $argLists;
26
	}
27
28
	/**
29
	 * @dataProvider latLongValueProvider
30
	 */
31
	public function testGivenLatLongInConstructor_getCoordinatesReturnsIt( LatLongValue $latLong ) {
32
		$location = new Location( $latLong );
33
		$this->assertTrue( $latLong->equals( $location->getCoordinates() ) );
34
	}
35
36
}
37