X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/e0de838b13a022d0ca460fbe6cd1c6c9f5129b79..c3788d765ed4e7ddf00794085af757714bc102cf:/test/php/Nominatim/ParameterParserTest.php diff --git a/test/php/Nominatim/ParameterParserTest.php b/test/php/Nominatim/ParameterParserTest.php index 75f6b276..57cf5f35 100644 --- a/test/php/Nominatim/ParameterParserTest.php +++ b/test/php/Nominatim/ParameterParserTest.php @@ -1,8 +1,16 @@ 'type', ), $oParams->getPreferredLanguages('default')); } + + public function testHasSetAny() + { + $oParams = new ParameterParser(array( + 'one' => '', + 'two' => 0, + 'three' => '0', + 'four' => '1', + 'five' => 'anystring' + )); + $this->assertFalse($oParams->hasSetAny(array())); + $this->assertFalse($oParams->hasSetAny(array(''))); + $this->assertFalse($oParams->hasSetAny(array('unknown'))); + $this->assertFalse($oParams->hasSetAny(array('one', 'two', 'three'))); + $this->assertTrue($oParams->hasSetAny(array('one', 'four'))); + $this->assertTrue($oParams->hasSetAny(array('four'))); + $this->assertTrue($oParams->hasSetAny(array('five'))); + } }