From 58d0e93fc999554297665d87481cf3ac8740a2fc Mon Sep 17 00:00:00 2001 From: brabli <67018167+Brabli@users.noreply.github.com> Date: Mon, 5 Aug 2024 12:01:40 +0100 Subject: [PATCH] Add type to const, change const name --- tests/Trait/MappableTraitTest.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/Trait/MappableTraitTest.php b/tests/Trait/MappableTraitTest.php index a10447b..dd07c79 100644 --- a/tests/Trait/MappableTraitTest.php +++ b/tests/Trait/MappableTraitTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\TestCase; class MappableTraitTest extends TestCase { - private const FLOAT = 123.456; + private const float COORD = 123.456; private MappableInterface $obj; @@ -21,7 +21,7 @@ class MappableTraitTest extends TestCase public function testSetLatitude(): void { - $this->assertInstanceOf(MappableInterface::class, $this->obj->setLatitude(self::FLOAT)); + $this->assertInstanceOf(MappableInterface::class, $this->obj->setLatitude(self::COORD)); } public function testGetLatitudeReturnsNull(): void @@ -31,13 +31,13 @@ class MappableTraitTest extends TestCase public function testGetLatitude(): void { - $this->obj->setLatitude(self::FLOAT); - $this->assertSame(self::FLOAT, $this->obj->getLatitude()); + $this->obj->setLatitude(self::COORD); + $this->assertSame(self::COORD, $this->obj->getLatitude()); } public function testSetLongitude(): void { - $this->assertInstanceOf(MappableInterface::class, $this->obj->setLongitude(self::FLOAT)); + $this->assertInstanceOf(MappableInterface::class, $this->obj->setLongitude(self::COORD)); } public function testGetLongitudeReturnsNull(): void @@ -47,8 +47,8 @@ class MappableTraitTest extends TestCase public function testGetLongitude(): void { - $this->obj->setLongitude(self::FLOAT); - $this->assertSame(self::FLOAT, $this->obj->getLongitude()); + $this->obj->setLongitude(self::COORD); + $this->assertSame(self::COORD, $this->obj->getLongitude()); } public function testIsGeocodedReturnsFalse(): void @@ -58,20 +58,20 @@ class MappableTraitTest extends TestCase public function testIsGeocodedReturnsFalseIfLatIsSet(): void { - $this->obj->setLatitude(self::FLOAT); + $this->obj->setLatitude(self::COORD); $this->assertFalse($this->obj->isGeocoded()); } public function testIsGeocodedReturnsFalseIfLonIsSet(): void { - $this->obj->setLongitude(self::FLOAT); + $this->obj->setLongitude(self::COORD); $this->assertFalse($this->obj->isGeocoded()); } public function testIsGeocodedReturnsTrueIfLatAndLonAreSet(): void { - $this->obj->setLatitude(self::FLOAT); - $this->obj->setLongitude(self::FLOAT); + $this->obj->setLatitude(self::COORD); + $this->obj->setLongitude(self::COORD); $this->assertTrue($this->obj->isGeocoded()); } @@ -89,5 +89,5 @@ class MappableTraitTest extends TestCase use MappableTrait; }; } - } +