This repository has been archived on 2024-11-28. You can view files and clone it, but cannot push or open issues or pull requests.
Incam_SGD/tests/util/ktutil/testAddQueryString.php

22 lines
754 B
PHP

<?php
require_once("../../../config/dmsDefaults.php");
require_once(KT_LIB_DIR . "/util/ktutil.inc");
$aTestVals = array(
"http://foo.bar/foo.php?foo=bar" => 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";
}
}