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

CircleTest::validConstructorProvider()   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\Circle;
9
10
/**
11
 * @covers \Maps\LegacyModel\Circle
12
 *
13
 * @licence GNU GPL v2+
14
 * @author Jeroen De Dauw < [email protected] >
15
 */
16
class CircleTest extends BaseElementTest {
17
18
	/**
19
	 * @see BaseElementTest::getClass
20
	 *
21
	 * @since 3.0
22
	 *
23
	 * @return string
24
	 */
25
	public function getClass() {
26
		return Circle::class;
27
	}
28
29
	public function validConstructorProvider() {
30
		$argLists = [];
31
32
		$argLists[] = [ new LatLongValue( 4, 2 ), 42 ];
33
		$argLists[] = [ new LatLongValue( 42, 2.2 ), 9000.1 ];
34
		$argLists[] = [ new LatLongValue( 4, 2 ), 1 ];
35
		$argLists[] = [ new LatLongValue( 4, 2 ), 0.1 ];
36
37
		return $argLists;
38
	}
39
40
	public function invalidConstructorProvider() {
41
		$argLists = [];
42
43
		$argLists[] = [ new LatLongValue( 4, 2 ), 0 ];
44
		$argLists[] = [ new LatLongValue( 4, 2 ), -42 ];
45
46
		return $argLists;
47
	}
48
49
	/**
50
	 * @dataProvider instanceProvider
51
	 *
52
	 * @param Circle $circle
53
	 * @param array $arguments
54
	 */
55
	public function testGetCircleCentre( Circle $circle, array $arguments ) {
56
		$this->assertTrue( $circle->getCircleCentre()->equals( $arguments[0] ) );
57
	}
58
59
	/**
60
	 * @dataProvider instanceProvider
61
	 *
62
	 * @param Circle $circle
63
	 * @param array $arguments
64
	 */
65
	public function testGetCircleRadius( Circle $circle, array $arguments ) {
66
		$this->assertEquals( $arguments[1], $circle->getCircleRadius() );
67
	}
68
69
}
70
71
72
73