]> git.openstreetmap.org Git - nominatim.git/blobdiff - test/php/Nominatim/ParameterParserTest.php
simplify getNearestRoadFeature function
[nominatim.git] / test / php / Nominatim / ParameterParserTest.php
index 75f6b276ae19fd5bcd143f399016fff36742a97e..361fefc1c8f15ecb35a9255bc537ae3fdc02511f 100644 (file)
@@ -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')));
+    }
 }