]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/OutputTest.php
use detailsPermaLink function on main website as well
[nominatim.git] / test / php / Nominatim / OutputTest.php
index ce9bfa35983400a09278065fd69417d328654085..486448456c10292bc1df6713a3197c6e6f5fd612 100644 (file)
@@ -51,6 +51,25 @@ class OutputTest extends \PHPUnit\Framework\TestCase
                 );
     }
 
+    public function testDetailsPermaLinkWithExtraPropertiesNode()
+    {
+        $aFeature = array('osm_type' => 'N', 'osm_id'=> 2, 'class' => 'amenity');
+        $this->assertSame(
+                detailsPermaLink($aFeature, 'something', 'class="xtype"'),
+                '<a class="xtype" href="details.php?osmtype=N&osmid=2&class=amenity">something</a>'
+                );
+    }
+
+    public function testDetailsPermaLinkWithExtraPropertiesTiger()
+    {
+        $aFeature = array('osm_type' => 'T', 'osm_id'=> 5, 'place_id' => 46);
+        $this->assertSame(
+                detailsPermaLink($aFeature, 'something', 'class="xtype"'),
+                '<a class="xtype" href="details.php?place_id=46">something</a>'
+                );
+    }
+
+