]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/ParameterParserTest.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / test / php / Nominatim / ParameterParserTest.php
index 111ce4a366a5a0c80091aef282a438c851a962e8..7381bdf84a9cca05f13a0aff3ce6f0804076d62b 100644 (file)
@@ -137,6 +137,9 @@ class ParameterParserTest extends \PHPUnit\Framework\TestCase
 
     public function testGetSet()
     {
+        $this->expectException(\Exception::class);
+        $this->expectExceptionMessage("Parameter 'val3' must be one of: foo, bar");
+
         $oParams = new ParameterParser(array(
                                         'val1' => 'foo',
                                         'val2' => '',
@@ -148,7 +151,7 @@ class ParameterParserTest extends \PHPUnit\Framework\TestCase
         $this->assertSame('foo', $oParams->getSet('val1', array('foo', 'bar')));
 
         $this->assertSame(false, $oParams->getSet('val2', array('foo', 'bar')));
-        $this->assertSame(0, $oParams->getSet('val3', array('foo', 'bar')));
+        $oParams->getSet('val3', array('foo', 'bar'));
     }
 
 
@@ -245,4 +248,4 @@ class ParameterParserTest extends \PHPUnit\Framework\TestCase
         $this->assertTrue($oParams->hasSetAny(array('four')));
         $this->assertTrue($oParams->hasSetAny(array('five')));
     }
-}
\ No newline at end of file
+}