X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/f42e40712e1a20d9e6ca1e497123a0c16c83be82..23fd1d032a96ee0821a103493d1a5d41a03546cb:/test/php/Nominatim/ParameterParserTest.php diff --git a/test/php/Nominatim/ParameterParserTest.php b/test/php/Nominatim/ParameterParserTest.php index 75f6b276..3b06e274 100644 --- a/test/php/Nominatim/ParameterParserTest.php +++ b/test/php/Nominatim/ParameterParserTest.php @@ -2,7 +2,7 @@ namespace Nominatim; -require_once(CONST_BasePath.'/lib/ParameterParser.php'); +require_once(CONST_LibDir.'/ParameterParser.php'); function userError($sError) @@ -246,4 +246,22 @@ class ParameterParserTest extends \PHPUnit\Framework\TestCase 'type' => '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'))); + } }