5 require_once(CONST_LibDir.'/output.php');
7 class OutputTest extends \PHPUnit\Framework\TestCase
9 public function testDetailsPermaLinkNode()
11 $aFeature = array('osm_type' => 'N', 'osm_id'=> 38274, 'class' => 'place');
13 detailsPermaLink($aFeature),
14 '<a href="details.php?osmtype=N&osmid=38274&class=place">node 38274</a>'
18 public function testDetailsPermaLinkWay()
20 $aFeature = array('osm_type' => 'W', 'osm_id'=> 65, 'class' => 'highway');
22 detailsPermaLink($aFeature),
23 '<a href="details.php?osmtype=W&osmid=65&class=highway">way 65</a>'
27 public function testDetailsPermaLinkRelation()
29 $aFeature = array('osm_type' => 'R', 'osm_id'=> 9908, 'class' => 'waterway');
31 detailsPermaLink($aFeature),
32 '<a href="details.php?osmtype=R&osmid=9908&class=waterway">relation 9908</a>'
36 public function testDetailsPermaLinkTiger()
38 $aFeature = array('osm_type' => 'T', 'osm_id'=> 2, 'place_id' => 334);
40 detailsPermaLink($aFeature, 'foo'),
41 '<a href="details.php?place_id=334">foo</a>'
45 public function testDetailsPermaLinkInterpolation()
47 $aFeature = array('osm_type' => 'I', 'osm_id'=> 400, 'place_id' => 3);
49 detailsPermaLink($aFeature, 'foo'),
50 '<a href="details.php?place_id=3">foo</a>'
54 public function testDetailsPermaLinkWithExtraPropertiesNode()
56 $aFeature = array('osm_type' => 'N', 'osm_id'=> 2, 'class' => 'amenity');
58 detailsPermaLink($aFeature, 'something', 'class="xtype"'),
59 '<a class="xtype" href="details.php?osmtype=N&osmid=2&class=amenity">something</a>'
63 public function testDetailsPermaLinkWithExtraPropertiesTiger()
65 $aFeature = array('osm_type' => 'T', 'osm_id'=> 5, 'place_id' => 46);
67 detailsPermaLink($aFeature, 'something', 'class="xtype"'),
68 '<a class="xtype" href="details.php?place_id=46">something</a>'