public function testNullIslandIsTheSameAsAZeroCoordsGeoPoint() { $gp = new GeoPoint([GeoPoint::PROPERTY_LONGITUDE => 0, GeoPoint::PROPERTY_LATITUDE => 0]); $this->assertTrue($gp->similarTo(GeoPoint::createNullIsland())); }
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()); }