Skip to content

Commit

Permalink
Preparing for new release.
Browse files Browse the repository at this point in the history
  • Loading branch information
kenguest committed May 31, 2016
1 parent 297b114 commit 4b64afa
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions tests/WayFullTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* Unit test class for Way related functionality.
*
* PHP Version 5
*
* @category Services
* @package Services_OpenStreetMap
* @subpackage UnitTesting
* @author Ken Guest <kguest@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @version Release: @package_version@
* @link WayTest.php
* @todo
*/

$version = '@package_version@';
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';

/**
* Unit test class for manipulation of Services_OpenStreetMap_Way.
*
* @category Services
* @package Services_OpenStreetMap
* @subpackage UnitTesting
* @author Ken Guest <kguest@php.net>
* @license BSD http://www.opensource.org/licenses/bsd-license.php
* @link WayTest.php
*/
class WayFullTest extends PHPUnit_Framework_TestCase
{

/**
* Test retrieving a way and some tags and attributes of it too.
*
* @return void
*/
public function testGetWayFull()
{
$id = 25978036;

$mock = new HTTP_Request2_Adapter_Mock();
$mock->addResponse(fopen(__DIR__ . '/responses/capabilities.xml', 'rb'));
$mock->addResponse(fopen(__DIR__ . '/responses/way.xml', 'rb'));
$mock->addResponse(fopen(__DIR__ . '/responses/way.xml', 'rb'));

$config = array(
'adapter' => $mock,
'server' => 'http://api06.dev.openstreetmap.org/'
);
$osm = new Services_OpenStreetMap($config);
$way = $osm->getWayFull($id, 1);
//var_dump($way);
$way = $osm->getWay($id);
//var_dump($way);
}
}

0 comments on commit 4b64afa

Please sign in to comment.