diff --git a/tests/util/ktutil/testAddQueryString.php b/tests/util/ktutil/testAddQueryString.php new file mode 100644 index 0000000..9876f8e --- /dev/null +++ b/tests/util/ktutil/testAddQueryString.php @@ -0,0 +1,21 @@ + array("http://foo.bar/foo.php", "foo=bar"), + "http://foo.bar/foo.php?foo=bar&bar=baz" => array("http://foo.bar/foo.php?foo=bar", "bar=baz"), + "http://foo.bar/foo.php?foo=bar&bar=baz&baz=quux" => array("http://foo.bar/foo.php?foo=bar", "bar=baz&baz=quux"), + "http://foo.bar/foo.php" => array("http://foo.bar/foo.php", ""), +); + +foreach ($aTestVals as $sExpected => $aArgs) { + $sResult = KTUtil::addQueryString($aArgs[0], $aArgs[1]); + if ($sResult !== $sExpected) { + print "FAIL!\n"; + print "Expected: $sExpected\n"; + print "Received: $sResult\n"; + } +} +