Browse files

test getValue as called with empty parameter

  • Loading branch information...
1 parent a292643 commit 16417eb1711a3c967418b0445941875839a839c2 @kenguest committed Apr 9, 2012
Showing with 17 additions and 0 deletions.
  1. +17 −0 tests/ConfigTest.php
View
17 tests/ConfigTest.php
@@ -118,6 +118,23 @@ public function testConfig3()
$osm->getConfig()->getValue('api');
}
+ public function testGetValueEmptyParameter()
+ {
+ $mock = new HTTP_Request2_Adapter_Mock();
+ $mock->addResponse(fopen(__DIR__ . '/responses/capabilities.xml', 'rb'));
+
+ $config = array('adapter' => $mock);
+ $osm = new Services_OpenStreetMap($config);
+
+ $configValues = $osm->getConfig()->getValue();
+ $this->assertEquals($configValues['server'], 'http://api.openstreetmap.org/');
+ $this->assertEquals($configValues['api_version'], '0.6');
+ $this->assertEquals($configValues['User-Agent'], 'Services_OpenStreetMap');
+ $this->assertNull($configValues['user']);
+ $this->assertNull($configValues['password']);
+ $this->assertNull($configValues['passwordfile']);
+ }
+
/**
* Setting an unrecognised config setting should raise an exception.
*

0 comments on commit 16417eb

Please sign in to comment.