-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d4d96aa
commit 1e6ec73
Showing
4 changed files
with
72 additions
and
3 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,66 @@ | ||
<?php | ||
|
||
namespace Maps\Tests\Presentation; | ||
|
||
use DataValues\Geo\Values\LatLongValue; | ||
use Maps\Elements\Location; | ||
use Maps\Presentation\KmlFormatter; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @covers \Maps\Presentation\KmlFormatter | ||
* | ||
* @licence GNU GPL v2+ | ||
* @author Jeroen De Dauw < [email protected] > | ||
*/ | ||
class KmlFormatterTest extends TestCase { | ||
|
||
public function testEmptyList() { | ||
$this->assertSame( | ||
'<?xml version="1.0" encoding="UTF-8"?> | ||
<kml xmlns="http://www.opengis.net/kml/2.2"> | ||
<Document> | ||
</Document> | ||
</kml>', | ||
( new KmlFormatter() )->formatLocationsAsKml() | ||
); | ||
} | ||
|
||
public function testSeveralLocations() { | ||
$this->assertSame( | ||
'<?xml version="1.0" encoding="UTF-8"?> | ||
<kml xmlns="http://www.opengis.net/kml/2.2"> | ||
<Document> | ||
<Placemark> | ||
<name><![CDATA[ first title]]></name> | ||
<description><![CDATA[ first text]]></description> | ||
<Point> | ||
<coordinates>23,42.42,0</coordinates> | ||
</Point> | ||
</Placemark> | ||
<Placemark> | ||
<name><![CDATA[ second title]]></name> | ||
<description><![CDATA[ second text]]></description> | ||
<Point> | ||
<coordinates>0,-1,0</coordinates> | ||
</Point> | ||
</Placemark> | ||
</Document> | ||
</kml>', | ||
( new KmlFormatter() )->formatLocationsAsKml( | ||
new Location( | ||
new LatLongValue( 42.42,23 ), | ||
'first title', | ||
'first text' | ||
), | ||
new Location( | ||
new LatLongValue( -1,0 ), | ||
'second title', | ||
'second text' | ||
) | ||
) | ||
); | ||
} | ||
|
||
} |
2 changes: 2 additions & 0 deletions
2
tests/Unit/ParameterExtractorTest.php → ...t/Presentation/ParameterExtractorTest.php
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