-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from acelaya/feature/float-locations
Feature/float locations
- Loading branch information
Showing
3 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
namespace ShlinkioTest\Shlink\Core\Entity; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use Shlinkio\Shlink\Core\Entity\VisitLocation; | ||
|
||
class VisitLocationTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function valuesFoundWhenExchangingArrayAreCastToString() | ||
{ | ||
$payload = [ | ||
'latitude' => 1000.7, | ||
'longitude' => -2000.4, | ||
]; | ||
|
||
$location = new VisitLocation(); | ||
$location->exchangeArray($payload); | ||
|
||
$this->assertSame('1000.7', $location->getLatitude()); | ||
$this->assertSame('-2000.4', $location->getLongitude()); | ||
} | ||
} |