obj = $this->getTraitObject(); } public function testSetLatitude(): void { $this->assertInstanceOf(GeocodeInterface::class, $this->obj->setLatitude(self::COORD)); } public function testGetLatitudeReturnsNull(): void { $this->assertNull($this->obj->getLatitude()); } public function testGetLatitude(): void { $this->obj->setLatitude(self::COORD); $this->assertSame(self::COORD, $this->obj->getLatitude()); } public function testSetLongitude(): void { $this->assertInstanceOf(GeocodeInterface::class, $this->obj->setLongitude(self::COORD)); } public function testGetLongitudeReturnsNull(): void { $this->assertNull($this->obj->getLongitude()); } public function testGetLongitude(): void { $this->obj->setLongitude(self::COORD); $this->assertSame(self::COORD, $this->obj->getLongitude()); } public function testIsGeocodedReturnsFalse(): void { $this->assertFalse($this->obj->isGeocoded()); } public function testIsGeocodedReturnsFalseIfLatIsSet(): void { $this->obj->setLatitude(self::COORD); $this->assertFalse($this->obj->isGeocoded()); } public function testIsGeocodedReturnsFalseIfLonIsSet(): void { $this->obj->setLongitude(self::COORD); $this->assertFalse($this->obj->isGeocoded()); } public function testIsGeocodedReturnsTrueIfLatAndLonAreSet(): void { $this->obj->setLatitude(self::COORD); $this->obj->setLongitude(self::COORD); $this->assertTrue($this->obj->isGeocoded()); } public function testIsGeocodedReturnsFalseIfLatAndLonAreBothZero(): void { $this->obj->setLatitude(0.000); $this->obj->setLongitude(0.000); $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 { return new class implements GeocodeInterface { use GeocodeTrait; public function getGeocodeData(): string { return ''; } }; } }