Browse files

check exception is thrown if non numeric value is given when construc…

…ting a 'user' Criterion
  • Loading branch information...
1 parent 842b0d6 commit 6fc73d3290f60e2a240c3f9c8d04a971d617c369 @kenguest committed Apr 10, 2012
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/CriterionTest.php
View
22 tests/CriterionTest.php
@@ -258,6 +258,28 @@ public function testTimeAfterOnly()
$changesets = $osm->searchChangesets(array($displayName, $c));
$this->assertInstanceOf('Services_OpenStreetMap_Changesets', $changesets);
}
+
+ /**
+ * user value must be numeric.
+ *
+ * @expectedException Services_OpenStreetMap_InvalidArgumentException
+ * @expectedExceptionMessage User UID must be numeric
+ *
+ * @return void
+ */
+ public function testInvalidUserValue()
+ {
+ $mock = new HTTP_Request2_Adapter_Mock();
+ $mock->addResponse(fopen(__DIR__ . '/responses/capabilities.xml', 'rb'));
+
+ $config = array(
+ 'adapter' => $mock,
+ 'server' => 'http://api06.dev.openstreetmap.org/',
+ );
+ $osm = new Services_OpenStreetMap($config);
+
+ $user = new Services_OpenStreetMap_Criterion('user', 'mustbenumeric');
+ }
}
// vim:set et ts=4 sw=4:
?>

0 comments on commit 6fc73d3

Please sign in to comment.