X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/57ae3d03a1ccfb464216b58e7e70abaf3a3d8c48..b133f2bc4cd5e467ff6ef10124416b1307cfdb62:/test/php/Nominatim/OutputTest.php diff --git a/test/php/Nominatim/OutputTest.php b/test/php/Nominatim/OutputTest.php index ce9bfa35..cbfebb7d 100644 --- a/test/php/Nominatim/OutputTest.php +++ b/test/php/Nominatim/OutputTest.php @@ -2,7 +2,7 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/output.php'); +require_once(CONST_LibDir.'/output.php'); class OutputTest extends \PHPUnit\Framework\TestCase { @@ -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' + ); + } }