X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/0daf2d5cbf2e7ec558b5bc4dfe511e0f8f2d76b2..d3f7465ccad9cce6c84f0b089282c5ece550c5ed:/test/php/Nominatim/ParameterParserTest.php diff --git a/test/php/Nominatim/ParameterParserTest.php b/test/php/Nominatim/ParameterParserTest.php index 75f6b276..361fefc1 100644 --- a/test/php/Nominatim/ParameterParserTest.php +++ b/test/php/Nominatim/ParameterParserTest.php @@ -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'))); + } }