1 | <?php |
||
18 | class GlobeCoordinateValueTest extends DataValueTest { |
||
19 | |||
20 | /** |
||
21 | * @see DataValueTest::getClass |
||
22 | * |
||
23 | * @return string |
||
24 | */ |
||
25 | public function getClass() { |
||
28 | |||
29 | public function validConstructorArgumentsProvider() { |
||
30 | $argLists = array(); |
||
31 | |||
32 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1 ); |
||
33 | $argLists[] = array( new LatLongValue( 4.2, 42 ), 1 ); |
||
34 | $argLists[] = array( new LatLongValue( 42, 4.2 ), 0.1 ); |
||
35 | $argLists[] = array( new LatLongValue( 42, 42 ), 0.1 ); |
||
36 | $argLists[] = array( new LatLongValue( -4.2, -4.2 ), 0.1 ); |
||
37 | $argLists[] = array( new LatLongValue( 4.2, -42 ), 0.1 ); |
||
38 | $argLists[] = array( new LatLongValue( -42, 4.2 ), 10 ); |
||
39 | $argLists[] = array( new LatLongValue( 0, 0 ), 0.001 ); |
||
40 | $argLists[] = array( new LatLongValue( 0, 0 ), 360 ); |
||
41 | $argLists[] = array( new LatLongValue( 0, 0 ), -360 ); |
||
42 | |||
43 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, GlobeCoordinateValue::GLOBE_EARTH ); |
||
44 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, 'terminus' ); |
||
45 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, "Schar's World" ); |
||
46 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, 'coruscant' ); |
||
47 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, null ); |
||
48 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), null ); |
||
49 | |||
50 | return $argLists; |
||
51 | } |
||
52 | |||
53 | public function invalidConstructorArgumentsProvider() { |
||
54 | $argLists = array(); |
||
55 | |||
56 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 361 ); |
||
57 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), -361 ); |
||
58 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 'foo' ); |
||
59 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), true ); |
||
60 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), array( 1 ) ); |
||
61 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), '1' ); |
||
62 | |||
63 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, '' ); |
||
64 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, true ); |
||
65 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, array( 1 ) ); |
||
66 | $argLists[] = array( new LatLongValue( 4.2, 4.2 ), 1, 1 ); |
||
67 | |||
68 | return $argLists; |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @dataProvider instanceProvider |
||
73 | */ |
||
74 | public function testGetLatitude( GlobeCoordinateValue $globeCoordinate, array $arguments ) { |
||
75 | $actual = $globeCoordinate->getLatitude(); |
||
76 | |||
77 | $this->assertInternalType( 'float', $actual ); |
||
78 | $this->assertSame( $arguments[0]->getLatitude(), $actual ); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @dataProvider instanceProvider |
||
83 | */ |
||
84 | public function testGetLongitude( GlobeCoordinateValue $globeCoordinate, array $arguments ) { |
||
90 | |||
91 | /** |
||
92 | * @dataProvider instanceProvider |
||
93 | */ |
||
94 | public function testGetPrecision( GlobeCoordinateValue $globeCoordinate, array $arguments ) { |
||
103 | |||
104 | /** |
||
105 | * @dataProvider instanceProvider |
||
106 | */ |
||
107 | public function testGetGlobe( GlobeCoordinateValue $globeCoordinate, array $arguments ) { |
||
121 | |||
122 | public function testArrayValueCompatibility() { |
||
154 | |||
155 | public function testSerializeCompatibility() { |
||
170 | |||
171 | public function testHashIsConsistentAcrossDifferentRuntimeEnvironments() { |
||
178 | |||
179 | } |
||
180 |