Compare commits
2 Commits
1.0.0
...
issue/14-c
| Author | SHA1 | Date | |
|---|---|---|---|
| 40fc3f59f8 | |||
| d8ecb41ac3 |
@@ -1,5 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## [x.x.x] xxxx-xx-xx
|
||||
- Coordinates set to 0, 0 will cause isGeocoded to return false
|
||||
|
||||
## [1.0.0] 2024-08-05
|
||||
- First major version release
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ trait GeocodeTrait
|
||||
|
||||
public function isGeocoded(): bool
|
||||
{
|
||||
return null !== $this->getLatitude() && null !== $this->getLongitude();
|
||||
return null !== $this->getLatitude() && null !== $this->getLongitude() && (0.0 !== $this->getLatitude() && 0.0 !== $this->getLongitude());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,11 +75,18 @@ final class GeocodeTraitTest extends TestCase
|
||||
$this->assertTrue($this->obj->isGeocoded());
|
||||
}
|
||||
|
||||
public function testIsGeocodeReturnsTrueIfLatAndLonAreBothZero(): void
|
||||
public function testIsGeocodedReturnsFalseIfLatAndLonAreBothZero(): void
|
||||
{
|
||||
$this->obj->setLatitude(0.000);
|
||||
$this->obj->setLongitude(0.000);
|
||||
$this->assertTrue($this->obj->isGeocoded());
|
||||
$this->assertFalse($this->obj->isGeocoded());
|
||||
}
|
||||
|
||||
public function testIsGeocodedReturnsFalseIfLatAndLonAreBothZeroInts(): void
|
||||
{
|
||||
$this->obj->setLatitude(0);
|
||||
$this->obj->setLongitude(0);
|
||||
$this->assertFalse($this->obj->isGeocoded());
|
||||
}
|
||||
|
||||
private function getTraitObject(): GeocodeInterface
|
||||
|
||||
Reference in New Issue
Block a user