X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/57ae3d03a1ccfb464216b58e7e70abaf3a3d8c48..acd8ca2ebda96c7dd6d7e2485a5c9c87dade0ffa:/test/php/Nominatim/OutputTest.php diff --git a/test/php/Nominatim/OutputTest.php b/test/php/Nominatim/OutputTest.php index ce9bfa35..b243ba47 100644 --- a/test/php/Nominatim/OutputTest.php +++ b/test/php/Nominatim/OutputTest.php @@ -10,48 +10,62 @@ class OutputTest extends \PHPUnit\Framework\TestCase { $aFeature = array('osm_type' => 'N', 'osm_id'=> 38274, 'class' => 'place'); $this->assertSame( - detailsPermaLink($aFeature), - 'node 38274' - ); + detailsPermaLink($aFeature), + 'node 38274' + ); } public function testDetailsPermaLinkWay() { $aFeature = array('osm_type' => 'W', 'osm_id'=> 65, 'class' => 'highway'); $this->assertSame( - detailsPermaLink($aFeature), - 'way 65' - ); + detailsPermaLink($aFeature), + 'way 65' + ); } public function testDetailsPermaLinkRelation() { $aFeature = array('osm_type' => 'R', 'osm_id'=> 9908, 'class' => 'waterway'); $this->assertSame( - detailsPermaLink($aFeature), - 'relation 9908' - ); + detailsPermaLink($aFeature), + 'relation 9908' + ); } public function testDetailsPermaLinkTiger() { $aFeature = array('osm_type' => 'T', 'osm_id'=> 2, 'place_id' => 334); $this->assertSame( - detailsPermaLink($aFeature, 'foo'), - 'foo' - ); + detailsPermaLink($aFeature, 'foo'), + 'foo' + ); } public function testDetailsPermaLinkInterpolation() { $aFeature = array('osm_type' => 'I', 'osm_id'=> 400, 'place_id' => 3); $this->assertSame( - detailsPermaLink($aFeature, 'foo'), - 'foo' - ); + detailsPermaLink($aFeature, 'foo'), + 'foo' + ); } + public function testDetailsPermaLinkWithExtraPropertiesNode() + { + $aFeature = array('osm_type' => 'N', 'osm_id'=> 2, 'class' => 'amenity'); + $this->assertSame( + detailsPermaLink($aFeature, 'something', 'class="xtype"'), + 'something' + ); + } - - + public function testDetailsPermaLinkWithExtraPropertiesTiger() + { + $aFeature = array('osm_type' => 'T', 'osm_id'=> 5, 'place_id' => 46); + $this->assertSame( + detailsPermaLink($aFeature, 'something', 'class="xtype"'), + 'something' + ); + } }