From 0e5a0c54065e83aa968e4baa673bf08ef87a3a73 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 23 Sep 2023 01:36:54 +0000 Subject: [PATCH] fix tests --- tests/Models/AddressMapperTest.php | 3 ++- tests/Models/AddressTest.php | 26 +++++++++++++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/tests/Models/AddressMapperTest.php b/tests/Models/AddressMapperTest.php index a5e457e..1317eb6 100755 --- a/tests/Models/AddressMapperTest.php +++ b/tests/Models/AddressMapperTest.php @@ -41,7 +41,8 @@ final class AddressMapperTest extends \PHPUnit\Framework\TestCase $address->address = 'Some address here'; $address->state = 'This is a state 123'; $address->setCountry('DE'); - $address->setGeo(['lat' => 12.1, 'long' => 11.2,]); + $address->lat = 12.1; + $address->lon = 11.2; $id = AddressMapper::create()->execute($address); self::assertGreaterThan(0, $address->id); diff --git a/tests/Models/AddressTest.php b/tests/Models/AddressTest.php index 228d96c..67d8da4 100755 --- a/tests/Models/AddressTest.php +++ b/tests/Models/AddressTest.php @@ -84,7 +84,8 @@ final class AddressTest extends \PHPUnit\Framework\TestCase $this->address->address = 'Some address here'; $this->address->state = 'This is a state 123'; $this->address->setCountry('Country'); - $this->address->setGeo(['lat' => 12.1, 'long' => 11.2,]); + $this->address->lat = 12.1; + $this->address->lon = 11.2; self::assertEquals($expected, $this->address->toArray()); } @@ -113,7 +114,8 @@ final class AddressTest extends \PHPUnit\Framework\TestCase $this->address->address = 'Some address here'; $this->address->state = 'This is a state 123'; $this->address->setCountry('Country'); - $this->address->setGeo(['lat' => 12.1, 'long' => 11.2,]); + $this->address->lat = 12.1; + $this->address->lon = 11.2; self::assertEquals($expected, $this->address->jsonSerialize()); self::assertEquals(\json_encode($this->address->jsonSerialize()), $this->address->serialize()); @@ -122,17 +124,15 @@ final class AddressTest extends \PHPUnit\Framework\TestCase public function testUnserialize() : void { $expected = [ - 'postal' => '0123456789', - 'city' => 'city', - 'country' => 'Country', - 'address' => 'Some address here', - 'state' => 'This is a state 123', - 'geo' => [ - 'lat' => 12.1, - 'long' => 11.2, - ], - 'name' => 'name', - 'addition' => 'addition', + 'postal' => '0123456789', + 'city' => 'city', + 'country' => 'Country', + 'address' => 'Some address here', + 'state' => 'This is a state 123', + 'lat' => 12.1, + 'lon' => 11.2, + 'name' => 'name', + 'addition' => 'addition', ]; $this->address->unserialize(\json_encode($expected));