예제 #1
0
 public function testNullIslandIsTheSameAsAZeroCoordsGeoPoint()
 {
     $gp = new GeoPoint([GeoPoint::PROPERTY_LONGITUDE => 0, GeoPoint::PROPERTY_LATITUDE => 0]);
     $this->assertTrue($gp->similarTo(GeoPoint::createNullIsland()));
 }
예제 #2
0
 public function testNullIslandIsAcceptedWhenConfiguredToDoSo()
 {
     $attribute = new GeoPointAttribute('gp', $this->getTypeMock(), [GeoPointAttribute::OPTION_NULL_ISLAND_AS_NULL => false]);
     $null_island = GeoPoint::createNullIsland();
     $valueholder = $attribute->createValueHolder();
     $valueholder->setValue($null_island);
     $this->assertNotSame($attribute->getNullValue(), $valueholder->getValue());
     $this->assertNotSame('', $valueholder->toNative());
     $this->assertTrue($valueholder->getValue()->isNullIsland());
 }