diff --git a/src/Presentation/KmlFormatter.php b/src/Presentation/KmlFormatter.php
index 7773e6c30..b8c28fcfe 100644
--- a/src/Presentation/KmlFormatter.php
+++ b/src/Presentation/KmlFormatter.php
@@ -42,10 +42,10 @@ function( Location $location ) {
private function locationToKmlPlacemark( Location $location ): string {
// TODO: escaping?
- $name = 'getTitle() . ']]>';
+ $name = 'getTitle() . ']]>';
// TODO: escaping?
- $description = 'getText() . ']]>';
+ $description = 'getText() . ']]>';
$coordinates = ''
. $this->escapeValue( $this->getCoordinateString( $location ) )
diff --git a/tests/Unit/Presentation/KmlFormatterTest.php b/tests/Unit/Presentation/KmlFormatterTest.php
index f503269e5..5a7c9b898 100644
--- a/tests/Unit/Presentation/KmlFormatterTest.php
+++ b/tests/Unit/Presentation/KmlFormatterTest.php
@@ -33,15 +33,15 @@ public function testSeveralLocations() {
-
-
+
+
23,42.42,0
-
-
+
+
0,-1,0
@@ -63,4 +63,26 @@ public function testSeveralLocations() {
);
}
+ public function testLocationWithoutTitleAndText() {
+ $this->assertSame(
+ '
+
+
+
+
+
+
+ 23,42.42,0
+
+
+
+',
+ ( new KmlFormatter() )->formatLocationsAsKml(
+ new Location(
+ new LatLongValue( 42.42,23 )
+ )
+ )
+ );
+ }
+
}