Skip to content

Commit

Permalink
[Core] Fix unit test for AbstractLocation
Browse files Browse the repository at this point in the history
  • Loading branch information
TiSiE committed Dec 22, 2017
1 parent 37556ce commit a99adf8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions module/Core/test/CoreTest/Entity/AbstractLocationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public function setup()
private function setTargetLocationAttributes()
{
$this->target
->setStreetname('street')
->setStreetnumber('99')
->setPostalCode('9999')
->setCity('XXXX')
->setRegion('YYYY')
Expand Down Expand Up @@ -120,7 +122,7 @@ public function testStringRepresentation()
{
$this->setTargetLocationAttributes();

$expect = "9999 XXXX, YYYY, ZZZZ ( 10, 20 )";
$expect = "street 99, 9999 XXXX, YYYY, ZZZZ ( 10, 20 )";

$this->assertEquals($expect, $this->target->__toString());
}
Expand All @@ -134,9 +136,11 @@ public function testConvertToAndFromJson()
$this->setTargetLocationAttributes();

$expect = json_encode([
'streetname' => 'street',
'streetnumber' => '99',
'city' => 'XXXX',
'region' => 'YYYY',
'postalCode' => '9999',
'postalcode' => '9999',
'country' => 'ZZZZ',
'coordinates' => [
'type' => 'Point',
Expand All @@ -150,7 +154,7 @@ public function testConvertToAndFromJson()
$this->target = new ConcreteLocation();
$this->target->fromString($json);

$expect = "9999 XXXX, YYYY, ZZZZ ( 10, 20 )";
$expect = "street 99, 9999 XXXX, YYYY, ZZZZ ( 10, 20 )";

$this->assertEquals($expect, $this->target->__toString(), 'Convert from json did not work');
}
Expand Down

0 comments on commit a99adf8

Please sign in to comment.