/** * Test the bboxToMinMax method * * @return void */ public function testBboxToMinMax() { $mock = new HTTP_Request2_Adapter_Mock(); $mock->addResponse(fopen(__DIR__ . '/responses/capabilities.xml', 'rb')); $config = array('adapter' => $mock); $osm = new Services_OpenStreetMap($config); $this->assertEquals($osm->bboxToMinMax('0.0327873', '52.260074599999996', '0.0767326', '52.282047299999995'), array('52.260074599999996', '0.0327873', '52.282047299999995', '0.0767326')); }
if (strstr($version, 'package_version')) { set_include_path(dirname(dirname(__FILE__)) . ':' . get_include_path()); } require_once 'Services/OpenStreetMap.php'; require_once 'HTTP/Request2.php'; require_once 'HTTP/Request2/Adapter/Mock.php'; $osm = new Services_OpenStreetMap(); $mock = new HTTP_Request2_Adapter_Mock(); $mock->addResponse(fopen(__DIR__ . '/../tests/responses/capabilities.xml', 'rb')); $mock->addResponse(fopen(__DIR__ . '/../tests/responses/changeset.xml', 'rb')); $mock->addResponse(fopen(__DIR__ . '/../tests/responses/changeset.xml', 'rb')); $mock->addResponse(fopen(__DIR__ . '/../tests/responses/diff_create_node.xml', 'rb')); $mock->addResponse(fopen(__DIR__ . '/../tests/responses/changeset_closed', 'rb')); $config = array('adapter' => $mock, 'server' => 'http://api.openstreetmap.org/', 'passwordfile' => __DIR__ . '/credentials'); $osm = new Services_OpenStreetMap($config); $mm = $osm->bboxToMinMax(-8.6519835, 52.638735499999996, -8.6214513, 52.649915099999994); $osm->get($mm[0], $mm[1], $mm[2], $mm[3]); $results = $osm->search(array("building" => "yes")); $changeset = $osm->createChangeset(); $changeset->begin('Additional details for ballinacurra gardens.'); foreach ($results as $result) { $addrStreet = $result->getTag('addr:street'); if ($addrStreet != 'Oakview Drive') { continue; } $user = $result->getUser(); $name = $result->getTag('name'); if ('exampleusername' == $user) { $tags = $result->getTags(); if (isset($tags['building_roof'])) { continue;