Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Eichhorn committed Sep 23, 2023
1 parent 677ac15 commit 0e5a0c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
3 changes: 2 additions & 1 deletion tests/Models/AddressMapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public function testCR() : void
$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);
Expand Down
26 changes: 13 additions & 13 deletions tests/Models/AddressTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public function testToArray() : void
$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());
}
Expand Down Expand Up @@ -113,7 +114,8 @@ public function testJsonSerialize() : void
$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());
Expand All @@ -122,17 +124,15 @@ public function testJsonSerialize() : void
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));
Expand Down

0 comments on commit 0e5a0c5

Please sign in to comment.