X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/7395eb97914eaf2405041513af60957d2d6702ba..e8caf8d78d046008b7a951f6b1ba5d015dafb6bc:/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'))); + } }