Skip to content

Commit

Permalink
Add some GlobeCoordinateValue tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw committed Sep 16, 2019
1 parent afd872c commit 596cc82
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/unit/Values/GlobeCoordinateValueTest.php
Expand Up @@ -310,4 +310,35 @@ public function testWithPrecisionDoesNotReturnTheSameInstance() {
);
}

public function testToArrayTypeKey() {
$globeValue = new GlobeCoordinateValue( new LatLongValue( 42, 23 ), 0.1 );

$this->assertSame(
'globecoordinate',
$globeValue->toArray()['type']
);
}

public function testToArrayValueKey() {
$globeValue = new GlobeCoordinateValue( new LatLongValue( 42, 23 ), 0.1 );

$this->assertSame(
[
'latitude' => 42.0,
'longitude' => 23.0,
'altitude' => null,
'precision' => 0.1,
'globe' => 'http://www.wikidata.org/entity/Q2',
],
$globeValue->toArray()['value']
);
}

public function testGetType() {
$this->assertSame(
'globecoordinate',
GlobeCoordinateValue::getType()
);
}

}

0 comments on commit 596cc82

Please sign in to comment.