summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtest/autoprepend.t10
-rwxr-xr-xtest/exec.t58
-rwxr-xr-xtest/getopt.t2
-rwxr-xr-xtest/it.t360
-rwxr-xr-xtest/it_cache.t22
-rwxr-xr-xtest/it_dbi.t220
-rwxr-xr-xtest/it_error.t4
-rwxr-xr-xtest/it_html.t126
-rwxr-xr-xtest/it_mail.t44
-rwxr-xr-xtest/it_pipe.t60
-rwxr-xr-xtest/it_text.t32
-rwxr-xr-xtest/it_url.t106
-rwxr-xr-xtest/it_url_slow.t10
-rwxr-xr-xtest/it_xml.t4
-rwxr-xr-xtest/itjs.t20
15 files changed, 539 insertions, 539 deletions
diff --git a/test/autoprepend.t b/test/autoprepend.t
index 287bdff..7aedeaa 100755
--- a/test/autoprepend.t
+++ b/test/autoprepend.t
@@ -7,31 +7,31 @@ $GLOBALS['it_text']->statictext = [
'foo' => ["de" => "bar {v1}", "en" => "qux {v1}"],
];
-is(
+is_(
T('foo'),
"bar ",
"simple T()"
);
-is(
+is_(
T('foo', 'en'),
"qux ",
"simple T() with language"
);
-is(
+is_(
T('foo', ['v1' => "gna<bber"]),
"bar gna&lt;bber",
"T() with quoted values"
);
-is(
+is_(
T('foo', ['v1' => "gna<bber"], 'en'),
"qux gna&lt;bber",
"T() with with quoted values and language"
);
-is(
+is_(
T('foo', 'en', ['v1' => "gna<bber"]),
"qux gna&lt;bber",
"T() with with language and quoted values"
diff --git a/test/exec.t b/test/exec.t
index 6757fc7..c113c87 100755
--- a/test/exec.t
+++ b/test/exec.t
@@ -3,67 +3,67 @@
# Tests for getopt in it.class
-is(it::exec("echo gna"), "gna\n", "basic exec");
-is(it::exec("echo {arg}", ['arg' => 'gnu'], ['arg' => "gna"]), "gna\n", "exec with argument");
-is(it::exec("echo {0}", 'gna'), "gna\n", "exec with positional argument");
-is(it::shell_command("egrep a{10}"), 'egrep a{10}', "exec with too large positional argument");
-is(it::shell_command("echo {arg}", ['arg' => 'gna07,-:blah']), "echo gna07,-:blah", "don't quote arguments with only whitelistes characters");
-is(it::shell_command("echo {arg}", ['arg' => '2>&1']), "echo '2>&1'", "quote arguments with dangerous characters");
-is(it::shell_command("echo {arg}", ['arg' => '']), "echo ''", "quote empty arguments");
-is(it::shell_command("echo {arg}", ['arg' => null]), "echo ", "remove null values");
-is(it::shell_command("echo {arg}", ['arg' => false]), "echo ", "remove false values");
-is(it::shell_command("echo {arg}", ['arg' => []]), "echo ", "remove empty arrays");
-is(it::shell_command("echo {arg}", (object)['arg' => "foo"]) , "echo foo", "allow objects");
-is(it::shell_command("echo {arg}", ['arg' => 1], ['arg' => 2]), "echo 2", "support varargs");
+is_(it::exec("echo gna"), "gna\n", "basic exec");
+is_(it::exec("echo {arg}", ['arg' => 'gnu'], ['arg' => "gna"]), "gna\n", "exec with argument");
+is_(it::exec("echo {0}", 'gna'), "gna\n", "exec with positional argument");
+is_(it::shell_command("egrep a{10}"), 'egrep a{10}', "exec with too large positional argument");
+is_(it::shell_command("echo {arg}", ['arg' => 'gna07,-:blah']), "echo gna07,-:blah", "don't quote arguments with only whitelistes characters");
+is_(it::shell_command("echo {arg}", ['arg' => '2>&1']), "echo '2>&1'", "quote arguments with dangerous characters");
+is_(it::shell_command("echo {arg}", ['arg' => '']), "echo ''", "quote empty arguments");
+is_(it::shell_command("echo {arg}", ['arg' => null]), "echo ", "remove null values");
+is_(it::shell_command("echo {arg}", ['arg' => false]), "echo ", "remove false values");
+is_(it::shell_command("echo {arg}", ['arg' => []]), "echo ", "remove empty arrays");
+is_(it::shell_command("echo {arg}", (object)['arg' => "foo"]) , "echo foo", "allow objects");
+is_(it::shell_command("echo {arg}", ['arg' => 1], ['arg' => 2]), "echo 2", "support varargs");
errlike(fn() => it::shell_command('echo -- $(echo {arg})', ['arg' => "-1"]), "leading - in value", "disallow leading dash in non-option args");
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['--longopt' => true]]),
"echo --longopt",
"options argument with long option"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['-onedash' => true]]),
"echo -onedash",
"... with long option but only one dash"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['-s' => true]]),
"echo -s",
"... with short option"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['--longopt' => 'val']]),
"echo --longopt val",
"... with long option with value"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['-onedash' => 'val']]),
"echo -onedash val",
"... with long option but only one dash and with value"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['-s' => 'val']]),
"echo -s val",
"... with short option with value"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['--longopt' => false]]),
"echo ",
"... with disabled long option"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['-s' => false]]),
"echo ",
"... with disabled short option"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['longopt' => true]]),
"echo --longopt",
"... long option without dashes"
);
-is(
+is_(
it::shell_command("echo {-opts}", ['-opts' => ['s' => true]]),
"echo -s",
"... short option without dashes"
@@ -75,16 +75,16 @@ foreach (["", "C", "de_CH", "de_CH.utf8"] as $locale)
$arg = "preüpost";
if (it::match('utf8', $locale))
$arg = it::any2utf8($arg);
- is(it::exec("echo {arg}", ['arg' => $arg]), $arg . "\n", "exec with argument and umlaut (locale '$locale')");
+ is_(it::exec("echo {arg}", ['arg' => $arg]), $arg . "\n", "exec with argument and umlaut (locale '$locale')");
}
-is(it::_exec_quotevalue(""), "''", "empty arg needs quotes");
-is(it::_exec_quotevalue("*"), "'*'", "special chars need quotes");
-is(it::_exec_quotevalue("Aabcdef0123456789"), "Aabcdef0123456789", "simple case. tel:debug_getdata needs unquoted vals");
+is_(it::_exec_quotevalue(""), "''", "empty arg needs quotes");
+is_(it::_exec_quotevalue("*"), "'*'", "special chars need quotes");
+is_(it::_exec_quotevalue("Aabcdef0123456789"), "Aabcdef0123456789", "simple case. tel:debug_getdata needs unquoted vals");
-is(it::system('exit 0'), 0, 'return exit code 0');
-is(it::system('exit 1'), 1, 'return exit code 1');
-is(it::system('exit -1'), 255, 'return exit code unsigned');
+is_(it::system('exit 0'), 0, 'return exit code 0');
+is_(it::system('exit 1'), 1, 'return exit code 1');
+is_(it::system('exit -1'), 255, 'return exit code unsigned');
@unlink('/tmp/it_system_test');
it::system('touch /tmp/it_system_test');
diff --git a/test/getopt.t b/test/getopt.t
index 380d0fd..4894819 100755
--- a/test/getopt.t
+++ b/test/getopt.t
@@ -16,7 +16,7 @@ function getopt_ok($argv, $exp, $name)
{
$_SERVER['argv'] = array_merge(['doesnotexist.php'], $argv);
$got = it::getopt($GLOBALS['usage'], ['noexit' => true]);
- return is($got, $exp, $name);
+ return is_($got, $exp, $name);
}
foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg)
diff --git a/test/it.t b/test/it.t
index bbda730..c74abef 100755
--- a/test/it.t
+++ b/test/it.t
@@ -15,7 +15,7 @@ setlocale(LC_CTYPE, 'de_CH'); # required becuase we're checking German umlauts
function _match($regex, $string, $expect, $name, $p = [])
{
$GLOBALS['TEST_MORE_LEVEL'] = 1;
- $pass = is (it::match($regex, $string, $p), $expect, $name);
+ $pass = is_(it::match($regex, $string, $p), $expect, $name);
if (!$pass)
{
diag(" regex given: $regex" . ($p ? " " .D($p) : ""));
@@ -290,7 +290,7 @@ ini_set('default_charset', 'utf-8');
#
# tests for it::replace()
#
-is(
+is_(
it::replace(
[
'regex1' => 'repl1',
@@ -301,79 +301,79 @@ is(
'test tr regex function'
);
-is(it::replace(['a' => "1", 'b' => "2"], "ab"), "12");
-is(it::replace(['!' => "x"], "!"), "x");
-is(it::replace(['\w' => "x"], "oö"), "xx");
-is(it::replace(['[[:alpha:]]' => "x"], "ö"), "x");
-is(it::replace(['\w' => "x", '#' => "!"], "#ö"), "!x");
-is(it::replace(['#' => "!", '\w' => "x"], "#ö"), "!x");
-is(it::replace(['ö' => "x"], "Ö"), "x");
-is(it::replace(['a' => "1"], "aaa", ['limit' => 1]), "1aa");
-is(it::replace(['\s' => "x"], it_html::entity_decode("&nbsp;")), "x", "match non-breaking space as white-space character");
-is(it::replace(['a' => "b", 'b' => "c"], "a"), "c");
+is_(it::replace(['a' => "1", 'b' => "2"], "ab"), "12");
+is_(it::replace(['!' => "x"], "!"), "x");
+is_(it::replace(['\w' => "x"], "oö"), "xx");
+is_(it::replace(['[[:alpha:]]' => "x"], "ö"), "x");
+is_(it::replace(['\w' => "x", '#' => "!"], "#ö"), "!x");
+is_(it::replace(['#' => "!", '\w' => "x"], "#ö"), "!x");
+is_(it::replace(['ö' => "x"], "Ö"), "x");
+is_(it::replace(['a' => "1"], "aaa", ['limit' => 1]), "1aa");
+is_(it::replace(['\s' => "x"], it_html::entity_decode("&nbsp;")), "x", "match non-breaking space as white-space character");
+is_(it::replace(['a' => "b", 'b' => "c"], "a"), "c");
-is(it::grep('ismatch', ['ismatch', 'isnomatch']), ['ismatch'], 'grep with simple regex');
-is(it::grep('!', ['ismatch!', 'isnomatch']), ['ismatch!'], '! in regex');
-is(it::grep('lower|UPPER', ['lower', 'LOWER', 'upper', 'UPPER'], ['casesensitive' => 1]), [0 => 'lower', 3 => 'UPPER'], 'set casesensitive');
-is(it::grep('match', ['foo' => 'match', 'bar' => 'gna']), ['foo' => 'match'], 'with keys');
-is(it::grep('2', [0 => 1, 1 => 2, 2 => 3], ['invert' => true]), [0 => 1, 2 => 3]);
+is_(it::grep('ismatch', ['ismatch', 'isnomatch']), ['ismatch'], 'grep with simple regex');
+is_(it::grep('!', ['ismatch!', 'isnomatch']), ['ismatch!'], '! in regex');
+is_(it::grep('lower|UPPER', ['lower', 'LOWER', 'upper', 'UPPER'], ['casesensitive' => 1]), [0 => 'lower', 3 => 'UPPER'], 'set casesensitive');
+is_(it::grep('match', ['foo' => 'match', 'bar' => 'gna']), ['foo' => 'match'], 'with keys');
+is_(it::grep('2', [0 => 1, 1 => 2, 2 => 3], ['invert' => true]), [0 => 1, 2 => 3]);
setlocale(LC_CTYPE, $oldlocale);
ini_set('default_charset', $oldcharset); # end of tests that must run with specific charset
# it::cidr_match tests
-is(it::cidr_match('192.168.2.3', '192.168.2.5'), false, "cidr_match full IP no match no mask");
-is(it::cidr_match('192.168.2.3', '192.168.2.3'), '192.168.2.3', "cidr_match full IP match no mask");
-is(it::cidr_match('192.168.2.3', '192.168.2.5/32'), false, "cidr_match full IP no match");
-is(it::cidr_match('192.168.2.5', '192.168.2.5/32'), '192.168.2.5/32', "cidr_match full IP match");
-is(it::cidr_match('192.168.1.1', '192.168.42.0/24'), false, "cidr_match no match");
-is(it::cidr_match('192.168.42.1', '192.168.42.0/24'), '192.168.42.0/24', "cidr_match basic match");
-is(it::cidr_match('192.168.42.42', '192.168.0.0/16'), '192.168.0.0/16', "cidr_match class b");
-is(it::cidr_match('192.168.42.42', '192.168.42.64/26'), false, "cidr_match offset no match");
-is(it::cidr_match('192.168.42.42', '192.168.42.32/27'), '192.168.42.32/27', "cidr_match offset");
-is(it::cidr_match('2001:918:ff83:101:798e:77c0:b722:fe56', '2001:918:ff83:101::/64'), '2001:918:ff83:101::/64', "cidr_match ipv6");
-is(it::cidr_match('2001:918:ff83:102:798e:77c0:b722:fe56', '2001:918:ff83:101::/64'), false, "cidr_match ipv6 no match" );
-is(it::cidr_match('10.11.12.13', ['10.0.0.0/8', '192.168.0.0./16']), '10.0.0.0/8', "cidr_match array");
+is_(it::cidr_match('192.168.2.3', '192.168.2.5'), false, "cidr_match full IP no match no mask");
+is_(it::cidr_match('192.168.2.3', '192.168.2.3'), '192.168.2.3', "cidr_match full IP match no mask");
+is_(it::cidr_match('192.168.2.3', '192.168.2.5/32'), false, "cidr_match full IP no match");
+is_(it::cidr_match('192.168.2.5', '192.168.2.5/32'), '192.168.2.5/32', "cidr_match full IP match");
+is_(it::cidr_match('192.168.1.1', '192.168.42.0/24'), false, "cidr_match no match");
+is_(it::cidr_match('192.168.42.1', '192.168.42.0/24'), '192.168.42.0/24', "cidr_match basic match");
+is_(it::cidr_match('192.168.42.42', '192.168.0.0/16'), '192.168.0.0/16', "cidr_match class b");
+is_(it::cidr_match('192.168.42.42', '192.168.42.64/26'), false, "cidr_match offset no match");
+is_(it::cidr_match('192.168.42.42', '192.168.42.32/27'), '192.168.42.32/27', "cidr_match offset");
+is_(it::cidr_match('2001:918:ff83:101:798e:77c0:b722:fe56', '2001:918:ff83:101::/64'), '2001:918:ff83:101::/64', "cidr_match ipv6");
+is_(it::cidr_match('2001:918:ff83:102:798e:77c0:b722:fe56', '2001:918:ff83:101::/64'), false, "cidr_match ipv6 no match" );
+is_(it::cidr_match('10.11.12.13', ['10.0.0.0/8', '192.168.0.0./16']), '10.0.0.0/8', "cidr_match array");
# it::is_private_ip tests
-is(it::is_private_ip('192.168.2.3'), true, "is_private_ip 192.168/16 example");
-is(it::is_private_ip('34.98.92.95'), false, "is_private_ip search.ch ipv4");
-is(it::is_private_ip('2600:1901:0:6fe0::'), false, "is_private_ip search.ch ipv6");
-is(it::is_private_ip('::1'), true, "is_private_ip loopback ipv6");
-is(it::is_private_ip('172.19.34.19'), true, "is_private_ip 172.16/12 example");
-is(it::is_private_ip('10.128.72.9'), true, "is_private_ip 10/8 example");
-is(it::is_private_ip('195.49.47.11'), false, "is_private_ip gna.ch ipv4");
-is(it::is_private_ip('2a01:2a8:9100:1911:abba:0:1:80'), false, "is_private_ip gna.ch ipv6");
-is(it::is_private_ip('fd12::1337:bab3:d00d'), true, "is_private_ip fc00::/7 example");
-is(it::is_private_ip('81.6.43.252'), false, "is_private_ip dunstkreis.ch ipv4");
-is(it::is_private_ip('2a02:169:200:d::15'), false, "is_private_ip dunstkreis.ch ipv6");
-is(it::is_private_ip('127.6.7.23'), true, "is_private_ip loopback ipv4");
-is(it::is_private_ip('169.254.6.9'), true, "is_private_ip 169.254/16 example");
-is(it::is_private_ip('gna.ch'), false, "is_private_ip gna.ch");
-is(it::is_private_ip('dunstkreis.ch'), false, "is_private_ip dunstkreis.ch");
-is(it::is_private_ip('loopback.gna.ch'), true, "is_private_ip loopback.gna.ch points to ::1");
-is(it::is_private_ip('cname.gna.ch'), true, "is_private_ip cname.gna.ch points to loopback.gna.ch");
-is(it::is_private_ip('pub4.gna.ch'), true, "is_private_ip pub4.gna.ch has public ipv4 but private ipv6");
-is(it::is_private_ip('pub6.gna.ch'), true, "is_private_ip pub6.gna.ch has public ipv6 but private ipv4");
+is_(it::is_private_ip('192.168.2.3'), true, "is_private_ip 192.168/16 example");
+is_(it::is_private_ip('34.98.92.95'), false, "is_private_ip search.ch ipv4");
+is_(it::is_private_ip('2600:1901:0:6fe0::'), false, "is_private_ip search.ch ipv6");
+is_(it::is_private_ip('::1'), true, "is_private_ip loopback ipv6");
+is_(it::is_private_ip('172.19.34.19'), true, "is_private_ip 172.16/12 example");
+is_(it::is_private_ip('10.128.72.9'), true, "is_private_ip 10/8 example");
+is_(it::is_private_ip('195.49.47.11'), false, "is_private_ip gna.ch ipv4");
+is_(it::is_private_ip('2a01:2a8:9100:1911:abba:0:1:80'), false, "is_private_ip gna.ch ipv6");
+is_(it::is_private_ip('fd12::1337:bab3:d00d'), true, "is_private_ip fc00::/7 example");
+is_(it::is_private_ip('81.6.43.252'), false, "is_private_ip dunstkreis.ch ipv4");
+is_(it::is_private_ip('2a02:169:200:d::15'), false, "is_private_ip dunstkreis.ch ipv6");
+is_(it::is_private_ip('127.6.7.23'), true, "is_private_ip loopback ipv4");
+is_(it::is_private_ip('169.254.6.9'), true, "is_private_ip 169.254/16 example");
+is_(it::is_private_ip('gna.ch'), false, "is_private_ip gna.ch");
+is_(it::is_private_ip('dunstkreis.ch'), false, "is_private_ip dunstkreis.ch");
+is_(it::is_private_ip('loopback.gna.ch'), true, "is_private_ip loopback.gna.ch points to ::1");
+is_(it::is_private_ip('cname.gna.ch'), true, "is_private_ip cname.gna.ch points to loopback.gna.ch");
+is_(it::is_private_ip('pub4.gna.ch'), true, "is_private_ip pub4.gna.ch has public ipv4 but private ipv6");
+is_(it::is_private_ip('pub6.gna.ch'), true, "is_private_ip pub6.gna.ch has public ipv6 but private ipv4");
# Stuff which is interpreted by curl
-is(it::is_private_ip('127.1'), true, "is_private_ip loopback ipv4 (zeroes omitted)");
-is(it::is_private_ip('127.0.0.01'), true, "is_private_ip loopback ipv4 (octal)");
-is(it::is_private_ip('127.0.0.0x1'), true, "is_private_ip loopback ipv4 (hexadecimal)");
-is(it::is_private_ip('127.01.0x1'), true, "is_private_ip private with omissions, octal and hexadecimal");
-is(it::is_private_ip('128.01.0x1'), false, "TODO: is_private_ip non-private with omissions, octal and hexadecimal");
+is_(it::is_private_ip('127.1'), true, "is_private_ip loopback ipv4 (zeroes omitted)");
+is_(it::is_private_ip('127.0.0.01'), true, "is_private_ip loopback ipv4 (octal)");
+is_(it::is_private_ip('127.0.0.0x1'), true, "is_private_ip loopback ipv4 (hexadecimal)");
+is_(it::is_private_ip('127.01.0x1'), true, "is_private_ip private with omissions, octal and hexadecimal");
+is_(it::is_private_ip('128.01.0x1'), false, "TODO: is_private_ip non-private with omissions, octal and hexadecimal");
# it::filter_keys tests
$data = ['a' => 1, 'b' => 2, 'c' => 3];
-is(it::filter_keys($data, 'a'), ['a' => 1], "select one key");
-is(it::filter_keys($data, ['a', 'b']), ['a' => 1, 'b' => 2], "select two keys with array");
-is(it::filter_keys($data, 'a,b'), ['a' => 1, 'b' => 2], "select two keys with string");
-is(
+is_(it::filter_keys($data, 'a'), ['a' => 1], "select one key");
+is_(it::filter_keys($data, ['a', 'b']), ['a' => 1, 'b' => 2], "select two keys with array");
+is_(it::filter_keys($data, 'a,b'), ['a' => 1, 'b' => 2], "select two keys with string");
+is_(
array_keys(it::filter_keys($data, 'b,a')),
['a', 'b'],
"keep order of data array per default");
-is(
+is_(
array_keys(it::filter_keys($data, 'b,a', ['reorder' => true])),
['b', 'a'],
"reorder with given key order");
@@ -383,7 +383,7 @@ is(
function _time($debug_time, $expected)
{
$GLOBALS['debug_time'] = $debug_time;
- is(it::date(), $expected, ".time-$debug_time");
+ is_(it::date(), $expected, ".time-$debug_time");
$GLOBALS['debug_time'] = '';
}
_time("2014-01-01", "2014-01-01 00:00:00");
@@ -394,165 +394,165 @@ _time("15-27-15", it::date('', '15:27:15'));
_time("152715", it::date('', '15:27:15'));
_time("yesterday", it::date('', 'yesterday'));
-is(it::date('date', '2011-10-25'), '25.10.2011', 'parse date string with strtotime');
-is(it::date('date', '2011-10-25 + 3 days'), '28.10.2011', 'date arithmetic (add)');
-is(it::date('date', '2011-10-25 - 3 days'), '22.10.2011', 'date arithmetic (subtract)');
-is(it::date('date', '2011-10-25 +-3 days'), '22.10.2011', 'date arithmetic (negative value)');
-is(it::date('date', '2011-10-25 --3 days'), '28.10.2011', 'date arithmetic (double negative)');
-is(it::date('date', '2011-10-25 ++ 3 days'), '28.10.2011', 'date arithmetic (double positive with space)');
-is(it::date('date', '2011-10-25 -+ 3 days'), '22.10.2011', 'date arithmetic (negative positive with space)');
-is(it::date('datetime', '2011-10-25 +12 hours +30 minutes'), '25.10.2011 12:30', 'datetime arithmetic (hours minutes)');
-is(it::date('datetime', '2011-10-25 +24 hours +30 minutes'), '26.10.2011 00:30', 'datetime arithmetic (hours minutes over midnight)');
-is(it::date('datetime', '2011-10-25 8:00 +10 minutes'), '25.10.2011 08:10', 'time arithmetic (add)');
-is(it::date('datetime', '2011-10-25 8:00 -10 minutes'), '25.10.2011 07:50', 'time arithmetic (subtract)');
-is(it::date('datetime', '2011-10-25 8:00 +-10 minutes'), '25.10.2011 07:50', 'time arithmetic (negative value)');
-is(it::date('datetime', '2011-10-25 8:00 --10 minutes'), '25.10.2011 08:10', 'time arithmetic (double negative)');
-is(it::date('datetime', '2011-10-25 --1 month --3 days 8:00 +- 4 hours +-10 minutes'), '28.11.2011 03:50', 'date and time arithmetic (multiple signs)');
-is(it::date('datetime', it::time()), it::date('datetime'), 'recognize int as timestamp');
-is(it::date('datetime', it::time()*1.0), it::date('datetime'), 'recognize float as timestamp');
-is(it::date('datetime', it::time() . ''), it::date('datetime'), 'recognize digit string as timestamp');
-is(it::date('datetime', '@' . it::time()), it::date('datetime'), 'recognize strtotime timestamp format');
-is(it::date('datetime', 10), it::date('datetime', "10"), 'numeric and string give same result');
-is(it::date('datetime', 10.0), it::date('datetime', "10"), '... as long as num is properly truncated');
-is(it::date('datetime', 10.5), it::date('datetime', "10"), '... with one digit after point');
-is(it::date('datetime', 10.56), it::date('datetime', "10"), '... with two digits after point');
-is(it::date('datetime', 1000000), it::date('datetime', "1000000"), '... large nummer');
-is(it::date('datetime', 1000000.543), it::date('datetime', "1000000"), '... large nummer and point');
-is(it::date('time', "10.5"), "10:05", 'interpret string with points with strtotime');
-is(it::date('time', "10.05"), "10:05", 'interpret string with points with strtotime');
-is(it::date('Y-m-d', "20000101"), '2000-01-01', 'interpret 8 digit strings as dates');
-is(it::date('Y-m-d', 20000101), '2000-01-01', 'interpret 8 numbers strings as dates');
-is(it::date('Y-m-d', "20990101"), '2099-01-01', 'interpret 8 digit strings as dates');
-is(it::date('Y-m-d', strtotime("1980-01-01")), '1980-01-01', 'interpret typical time stamps correctly');
+is_(it::date('date', '2011-10-25'), '25.10.2011', 'parse date string with strtotime');
+is_(it::date('date', '2011-10-25 + 3 days'), '28.10.2011', 'date arithmetic (add)');
+is_(it::date('date', '2011-10-25 - 3 days'), '22.10.2011', 'date arithmetic (subtract)');
+is_(it::date('date', '2011-10-25 +-3 days'), '22.10.2011', 'date arithmetic (negative value)');
+is_(it::date('date', '2011-10-25 --3 days'), '28.10.2011', 'date arithmetic (double negative)');
+is_(it::date('date', '2011-10-25 ++ 3 days'), '28.10.2011', 'date arithmetic (double positive with space)');
+is_(it::date('date', '2011-10-25 -+ 3 days'), '22.10.2011', 'date arithmetic (negative positive with space)');
+is_(it::date('datetime', '2011-10-25 +12 hours +30 minutes'), '25.10.2011 12:30', 'datetime arithmetic (hours minutes)');
+is_(it::date('datetime', '2011-10-25 +24 hours +30 minutes'), '26.10.2011 00:30', 'datetime arithmetic (hours minutes over midnight)');
+is_(it::date('datetime', '2011-10-25 8:00 +10 minutes'), '25.10.2011 08:10', 'time arithmetic (add)');
+is_(it::date('datetime', '2011-10-25 8:00 -10 minutes'), '25.10.2011 07:50', 'time arithmetic (subtract)');
+is_(it::date('datetime', '2011-10-25 8:00 +-10 minutes'), '25.10.2011 07:50', 'time arithmetic (negative value)');
+is_(it::date('datetime', '2011-10-25 8:00 --10 minutes'), '25.10.2011 08:10', 'time arithmetic (double negative)');
+is_(it::date('datetime', '2011-10-25 --1 month --3 days 8:00 +- 4 hours +-10 minutes'), '28.11.2011 03:50', 'date and time arithmetic (multiple signs)');
+is_(it::date('datetime', it::time()), it::date('datetime'), 'recognize int as timestamp');
+is_(it::date('datetime', it::time()*1.0), it::date('datetime'), 'recognize float as timestamp');
+is_(it::date('datetime', it::time() . ''), it::date('datetime'), 'recognize digit string as timestamp');
+is_(it::date('datetime', '@' . it::time()), it::date('datetime'), 'recognize strtotime timestamp format');
+is_(it::date('datetime', 10), it::date('datetime', "10"), 'numeric and string give same result');
+is_(it::date('datetime', 10.0), it::date('datetime', "10"), '... as long as num is properly truncated');
+is_(it::date('datetime', 10.5), it::date('datetime', "10"), '... with one digit after point');
+is_(it::date('datetime', 10.56), it::date('datetime', "10"), '... with two digits after point');
+is_(it::date('datetime', 1000000), it::date('datetime', "1000000"), '... large nummer');
+is_(it::date('datetime', 1000000.543), it::date('datetime', "1000000"), '... large nummer and point');
+is_(it::date('time', "10.5"), "10:05", 'interpret string with points with strtotime');
+is_(it::date('time', "10.05"), "10:05", 'interpret string with points with strtotime');
+is_(it::date('Y-m-d', "20000101"), '2000-01-01', 'interpret 8 digit strings as dates');
+is_(it::date('Y-m-d', 20000101), '2000-01-01', 'interpret 8 numbers strings as dates');
+is_(it::date('Y-m-d', "20990101"), '2099-01-01', 'interpret 8 digit strings as dates');
+is_(it::date('Y-m-d', strtotime("1980-01-01")), '1980-01-01', 'interpret typical time stamps correctly');
# it::uc*
-is(it::ucfirst('foo bär über'), 'Foo bär über');
-is(it::ucwords('foo bär über'), 'Foo Bär Über');
+is_(it::ucfirst('foo bär über'), 'Foo bär über');
+is_(it::ucwords('foo bär über'), 'Foo Bär Über');
# it::substr_replace
-is(it::substr_replace('abcdefgh', 'xyz', 2, 4), substr_replace('abcdefgh', 'xyz', 2, 4), 'it::substr_replace the same as substr_replace for ascii');
-is(it::substr_replace('✔☯♥', '☃☃', 1, 1), '✔☃☃♥', 'it::substr_replace for utf-8');
-is(it::substr_replace('', 'xyz', 0, 0), substr_replace('', 'xyz', 0, 0), 'it::substr_replace with empty haystack the same as substr_replace');
-is(it::substr_replace('abc', 'xyz', 0, 2), substr_replace('abc', 'xyz', 0, 2), 'it::substr_replace replacing to end of haystack');
-is(it::substr_replace('abc', 'xyz', 0, 10), substr_replace('abc', 'xyz', 0, 10), 'it::substr_replace replacing past end of haystack');
-is(it::substr_replace('abcdefgh', 'xyz', 10, 4), substr_replace('abcdefgh', 'xyz', 10, 4), 'it::substr_replace outside of string');
-
-is(it::any2utf8('Meier'), 'Meier', "it::any2utf8 ascii input");
-is(it::any2utf8('Müller'), 'Müller', "it::any2utf8 utf8 input");
-is(it::any2utf8('Aslı'), 'Aslı', "it::any2utf8 utf8 non-latin1 input");
-is(it::any2utf8(it::utf8_decode('Müller')), 'Müller', "it::any2utf8 latin1 input");
-
-is(it::any2utf8(
+is_(it::substr_replace('abcdefgh', 'xyz', 2, 4), substr_replace('abcdefgh', 'xyz', 2, 4), 'it::substr_replace the same as substr_replace for ascii');
+is_(it::substr_replace('✔☯♥', '☃☃', 1, 1), '✔☃☃♥', 'it::substr_replace for utf-8');
+is_(it::substr_replace('', 'xyz', 0, 0), substr_replace('', 'xyz', 0, 0), 'it::substr_replace with empty haystack the same as substr_replace');
+is_(it::substr_replace('abc', 'xyz', 0, 2), substr_replace('abc', 'xyz', 0, 2), 'it::substr_replace replacing to end of haystack');
+is_(it::substr_replace('abc', 'xyz', 0, 10), substr_replace('abc', 'xyz', 0, 10), 'it::substr_replace replacing past end of haystack');
+is_(it::substr_replace('abcdefgh', 'xyz', 10, 4), substr_replace('abcdefgh', 'xyz', 10, 4), 'it::substr_replace outside of string');
+
+is_(it::any2utf8('Meier'), 'Meier', "it::any2utf8 ascii input");
+is_(it::any2utf8('Müller'), 'Müller', "it::any2utf8 utf8 input");
+is_(it::any2utf8('Aslı'), 'Aslı', "it::any2utf8 utf8 non-latin1 input");
+is_(it::any2utf8(it::utf8_decode('Müller')), 'Müller', "it::any2utf8 latin1 input");
+
+is_(it::any2utf8(
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'), # omit soft hyphen cause we filter it
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ',
"it::any2utf8 utf8 input (exhaustive alphabet)");
-is(it::any2utf8(
+is_(it::any2utf8(
it::utf8_decode(' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ')),
' !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ¡¢£¤¥¦§¨©ª«¬®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ',
"it::any2utf8 latin1 input (exhaustive alphabet)");
-is(it::any2utf8(it::utf8_encode("ü")), "ü", "it::any2utf8 double encoding");
+is_(it::any2utf8(it::utf8_encode("ü")), "ü", "it::any2utf8 double encoding");
-is(it::any2utf8("Meier"), "Meier", "it::any2utf8 ascii");
-is(it::any2utf8("Müller"), "Müller", "it::any2utf8 utf-8 latin1");
-is(it::any2utf8("Aslı"), "Aslı", "it::any2utf8 utf-8 non-latin1");
-is(it::any2utf8("é»"), "é»", "it::any2utf8 utf-8 latin1 special combination");
-is(it::any2utf8(it::utf8_encode("Müller")), "Müller", "it::any2utf8 doubly encoded utf8");
-is(it::any2utf8(it::utf8_encode(it::utf8_encode("Müller"))), "Müller", "it::any2utf8 triply encoded utf8");
-is(it::any2utf8(it::utf8_decode("Müller")), "Müller", "it::any2utf8 incorrectly encoded latin1");
-is(it::any2utf8("a💚b"), "a💚b", "it::any2utf8 correctly handles 4-byte utf-8 character GREEN HEART");
+is_(it::any2utf8("Meier"), "Meier", "it::any2utf8 ascii");
+is_(it::any2utf8("Müller"), "Müller", "it::any2utf8 utf-8 latin1");
+is_(it::any2utf8("Aslı"), "Aslı", "it::any2utf8 utf-8 non-latin1");
+is_(it::any2utf8("é»"), "é»", "it::any2utf8 utf-8 latin1 special combination");
+is_(it::any2utf8(it::utf8_encode("Müller")), "Müller", "it::any2utf8 doubly encoded utf8");
+is_(it::any2utf8(it::utf8_encode(it::utf8_encode("Müller"))), "Müller", "it::any2utf8 triply encoded utf8");
+is_(it::any2utf8(it::utf8_decode("Müller")), "Müller", "it::any2utf8 incorrectly encoded latin1");
+is_(it::any2utf8("a💚b"), "a💚b", "it::any2utf8 correctly handles 4-byte utf-8 character GREEN HEART");
-is(it::any2utf8(["foo", it::utf8_decode("bär")]), ["foo", "bär"], "any2utf8 on arrays");
-is(it::any2utf8(["foo", [it::utf8_decode("bär")]]), ["foo", ["bär"]], "any2utf8 on recursive arrays");
-is(it::any2utf8([1, true, false, null]), [1, true, false, null], "any2utf8 should leave types alone");
-is(it::any2utf8([it::utf8_decode('Müller') => it::utf8_decode('Müller')]), ['Müller' => 'Müller'], "it::any2utf8 latin1 keys");
+is_(it::any2utf8(["foo", it::utf8_decode("bär")]), ["foo", "bär"], "any2utf8 on arrays");
+is_(it::any2utf8(["foo", [it::utf8_decode("bär")]]), ["foo", ["bär"]], "any2utf8 on recursive arrays");
+is_(it::any2utf8([1, true, false, null]), [1, true, false, null], "any2utf8 should leave types alone");
+is_(it::any2utf8([it::utf8_decode('Müller') => it::utf8_decode('Müller')]), ['Müller' => 'Müller'], "it::any2utf8 latin1 keys");
-is(it::any2utf8("\xc2\xad"), "", "it::any2utf8 remove soft hyphens");
+is_(it::any2utf8("\xc2\xad"), "", "it::any2utf8 remove soft hyphens");
foreach ([ 'a' => 'ä', 'e' => 'ë', 'i' => 'ï', 'o' => 'ö', 'u' => 'ü' ] as $src => $dst)
{
- is(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
+ is_(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
$src = mb_strtoupper($src);
$dst = mb_strtoupper($dst);
- is(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
+ is_(it::any2utf8("$src\xcc\x88"), $dst, "it::any2utf8 normalize combining diaeresis $dst to umlaut code $dst");
}
-is(it::any2utf8("\x65\xcc\x81"), "é", "it::any2utf8 convert to normal form C");
-is(it::any2utf8("\u{0338}\u{0338}a\u{0338}b \u{0338}\u{0338}c"), "a\u{0338}b c", "it::any2utf8 remove combining chars at start and after blank");
+is_(it::any2utf8("\x65\xcc\x81"), "é", "it::any2utf8 convert to normal form C");
+is_(it::any2utf8("\u{0338}\u{0338}a\u{0338}b \u{0338}\u{0338}c"), "a\u{0338}b c", "it::any2utf8 remove combining chars at start and after blank");
foreach ([$dummy, false, true, null, 1, "a", "Ä", "/", []] as $var)
- is(it::json_decode(it::json_encode($var)), $var);
-is(it::json_decode('{"foo":"bar"}')->foo, "bar");
-is(it::json_decode('{"foo":"bar"}', ['assoc' => true])['foo'], "bar");
-is(it::json_decode("\nnull\n\n", ['it_error' => ['fatal' => true]]), null, 'json_decode pretty printed null value');
+ is_(it::json_decode(it::json_encode($var)), $var);
+is_(it::json_decode('{"foo":"bar"}')->foo, "bar");
+is_(it::json_decode('{"foo":"bar"}', ['assoc' => true])['foo'], "bar");
+is_(it::json_decode("\nnull\n\n", ['it_error' => ['fatal' => true]]), null, 'json_decode pretty printed null value');
-is(it::cdist(null), true);
-is(it::cdist(), true);
+is_(it::cdist(null), true);
+is_(it::cdist(), true);
errlike(function() {it::cdist(false);}, "invalid file name");
errlike(function() {it::cdist("foo", false, "bar");}, "invalid file name");
-is(it::sort(["2!","19!","1!"]), ["1!", "19!", "2!"]);
-is(it::sort(["2!","19!","1!"], "r"), ["2!", "19!", "1!"]);
-is(it::sort(["2!","19!","1!"], "rn"), ["19!", "2!", "1!"]);
-is(it::sort(["ccc", "b", "aa"], "", function ($a, $b) { return strlen($a) <=> strlen($b); }), ["b", "aa", "ccc"]);
-is(it::sort(["ccc", "b", "aa"], function ($a, $b) { return strlen($a) <=> strlen($b); }), ["b", "aa", "ccc"]);
-is(it::sort(["ccc", "b", "aa"], "a", function ($a, $b) { return strlen($a) <=> strlen($b); }), [1 => "b", 2 => "aa", 0 => "ccc"]);
-is(it::sort(["ccc" => 2, "b" => 3, "aa" => 1], "k", function ($a, $b) { return strlen($a) <=> strlen($b); }), ['b' => 3, 'aa' => 1, 'ccc' => 2]);
-is(it::sort(["ccc", "b", "aa"], "strlen"), ["b", "aa", "ccc"]);
-
-is(it::mod(-9, 4), 3);
-is(it::mod(-8, 4), 0);
-is(it::mod(0, 4), 0);
-is(it::mod(7, 4), 3);
-
-is(it::map('5*$k+$v', [0 => 1, 1 => 2]), [1, 7]);
-is(it::map(function($k, $v) {return 5*$k+$v;}, [0 => 1, 1 => 2]), [1, 7]);
-is(it::map(function($v) {return 2*$v;}, [0 => 1, 1 => 2]), [2, 4]);
-is(it::map('strlen', ["aaa", "aa"]), [3, 2]);
-is(it::map('it::ucfirst', ["aaa"]), ["Aaa"]);
+is_(it::sort(["2!","19!","1!"]), ["1!", "19!", "2!"]);
+is_(it::sort(["2!","19!","1!"], "r"), ["2!", "19!", "1!"]);
+is_(it::sort(["2!","19!","1!"], "rn"), ["19!", "2!", "1!"]);
+is_(it::sort(["ccc", "b", "aa"], "", function ($a, $b) { return strlen($a) <=> strlen($b); }), ["b", "aa", "ccc"]);
+is_(it::sort(["ccc", "b", "aa"], function ($a, $b) { return strlen($a) <=> strlen($b); }), ["b", "aa", "ccc"]);
+is_(it::sort(["ccc", "b", "aa"], "a", function ($a, $b) { return strlen($a) <=> strlen($b); }), [1 => "b", 2 => "aa", 0 => "ccc"]);
+is_(it::sort(["ccc" => 2, "b" => 3, "aa" => 1], "k", function ($a, $b) { return strlen($a) <=> strlen($b); }), ['b' => 3, 'aa' => 1, 'ccc' => 2]);
+is_(it::sort(["ccc", "b", "aa"], "strlen"), ["b", "aa", "ccc"]);
+
+is_(it::mod(-9, 4), 3);
+is_(it::mod(-8, 4), 0);
+is_(it::mod(0, 4), 0);
+is_(it::mod(7, 4), 3);
+
+is_(it::map('5*$k+$v', [0 => 1, 1 => 2]), [1, 7]);
+is_(it::map(function($k, $v) {return 5*$k+$v;}, [0 => 1, 1 => 2]), [1, 7]);
+is_(it::map(function($v) {return 2*$v;}, [0 => 1, 1 => 2]), [2, 4]);
+is_(it::map('strlen', ["aaa", "aa"]), [3, 2]);
+is_(it::map('it::ucfirst', ["aaa"]), ["Aaa"]);
$dom = new DOMDocument;
$dom->loadXML('<foo>42</foo>');
-is(it::map('$v->C14N()', $dom->childNodes), [ '<foo>42</foo>' ], "Traversable: Needs copy, not modifiable in-place");
+is_(it::map('$v->C14N()', $dom->childNodes), [ '<foo>42</foo>' ], "Traversable: Needs copy, not modifiable in-place");
# Generator function
function _generator() { foreach (range(1,2) as $v) yield $v; }
-is(it::map('2*$v', _generator()), [2, 4], "Generator");
+is_(it::map('2*$v', _generator()), [2, 4], "Generator");
# Special values which are not callable
-is(it::map('null', ["aaa", "aa"]), [null, null]);
-is(it::map('1', ["aaa", "aa"]), [1, 1]);
-is(it::map(42, ["aaa", "aa"]), [42, 42]);
+is_(it::map('null', ["aaa", "aa"]), [null, null]);
+is_(it::map('1', ["aaa", "aa"]), [1, 1]);
+is_(it::map(42, ["aaa", "aa"]), [42, 42]);
# Only map selected keys
-is(it::map('2*$v', [3, 4, 5], ['keys' => '0,1']), [6, 8, 5]);
-is(it::map('2*$v', [3, 4, 5], ['keys' => [0,1]]), [6, 8, 5]);
-is(it::map('2*$v', ['foo' => 1, 'bar' => 2], ['keys' => 'foo']), ['foo' => 2, 'bar' => 2]);
+is_(it::map('2*$v', [3, 4, 5], ['keys' => '0,1']), [6, 8, 5]);
+is_(it::map('2*$v', [3, 4, 5], ['keys' => [0,1]]), [6, 8, 5]);
+is_(it::map('2*$v', ['foo' => 1, 'bar' => 2], ['keys' => 'foo']), ['foo' => 2, 'bar' => 2]);
# it::filter
-is(it::filter('$v > 2', [1, 5 => 2, 2 => 3]), [2 => 3]);
-is(it::filter('$k > 2', [1, 5 => 2, 2 => 3]), [5 => 2]);
-is(it::filter(function($v) {return $v > 2;}, [1, 5 => 2, 2 => 3]), [2 => 3]);
-is(it::filter(function($k, $v) {return $k > 2;}, [1, 5 => 2, 2 => 3]), [5 => 2]);
-
-is(it::split("b", "aba"), ["a", "a"]);
-is(it::split("b", "aBa"), ["a", "a"]);
-is(it::split("b", "abba"), ["a", "", "a"]);
-is(it::split("b", "ababa", ['limit' => 2]), ["a", "aba"]);
-is(it::split("b", "abbba", ['no_empty' => true]), ["a", "a"]);
-is(it::split("(b)", "aba", ['delim_capture' => true]), ["a", "b", "a"]);
-is(it::split("b", "aabaa", ['offset_capture' => true]), [["aa", 0], ["aa", 3]]);
+is_(it::filter('$v > 2', [1, 5 => 2, 2 => 3]), [2 => 3]);
+is_(it::filter('$k > 2', [1, 5 => 2, 2 => 3]), [5 => 2]);
+is_(it::filter(function($v) {return $v > 2;}, [1, 5 => 2, 2 => 3]), [2 => 3]);
+is_(it::filter(function($k, $v) {return $k > 2;}, [1, 5 => 2, 2 => 3]), [5 => 2]);
+
+is_(it::split("b", "aba"), ["a", "a"]);
+is_(it::split("b", "aBa"), ["a", "a"]);
+is_(it::split("b", "abba"), ["a", "", "a"]);
+is_(it::split("b", "ababa", ['limit' => 2]), ["a", "aba"]);
+is_(it::split("b", "abbba", ['no_empty' => true]), ["a", "a"]);
+is_(it::split("(b)", "aba", ['delim_capture' => true]), ["a", "b", "a"]);
+is_(it::split("b", "aabaa", ['offset_capture' => true]), [["aa", 0], ["aa", 3]]);
$tmpfile = tempnam("/tmp", "it_test");
it::file_put_contents($tmpfile, "abc");
-is(($fh = it::fopen($tmpfile, "r")) ? fgets($fh) : null, "abc");
-is(it::file_get_contents($tmpfile), "abc");
-is(it::file_get_contents($tmpfile, false, null, 1), "bc");
-is(it::file_get_contents($tmpfile, false, null, 0, 2), "ab");
-is(it::file_get_contents($tmpfile, false, null, 1, 1), "b");
-is(it::file($tmpfile), ["abc"]);
+is_(($fh = it::fopen($tmpfile, "r")) ? fgets($fh) : null, "abc");
+is_(it::file_get_contents($tmpfile), "abc");
+is_(it::file_get_contents($tmpfile, false, null, 1), "bc");
+is_(it::file_get_contents($tmpfile, false, null, 0, 2), "ab");
+is_(it::file_get_contents($tmpfile, false, null, 1, 1), "b");
+is_(it::file($tmpfile), ["abc"]);
ob_start();
it::readfile($tmpfile);
-is(ob_get_clean(), "abc");
+is_(ob_get_clean(), "abc");
it::file_put($tmpfile, "bb");
-is(it::file_get($tmpfile), "bb");
+is_(it::file_get($tmpfile), "bb");
unlink($tmpfile);
requesturi(it::utf8_decode("lüönd"), "lüönd");
@@ -565,7 +565,7 @@ function requesturi($teststring, $expect)
{
$_SERVER['REQUEST_URI'] = urlencode($teststring);
it::params2utf8();
- is(urldecode($_SERVER['REQUEST_URI']), $expect, "parms2utf8('$expect')"); # NOPHPLINT
+ is_(urldecode($_SERVER['REQUEST_URI']), $expect, "parms2utf8('$expect')"); # NOPHPLINT
}
_getopt(["val"], ['foo' => "val"]);
@@ -592,8 +592,8 @@ function _getopt($in, $expect)
-b, --brg=ARG Have another arg
");
- is($opts, ['args' => $expect['args'] ?? []] + $expect);
+ is_($opts, ['args' => $expect['args'] ?? []] + $expect);
}
-is(it::urldecode("a%61%E4"), "aaä");
-is(it::parse_str("%E4[%E4][%E4]=%E4"), ['ä' => ['ä' => ['ä' => 'ä']]]);
+is_(it::urldecode("a%61%E4"), "aaä");
+is_(it::parse_str("%E4[%E4][%E4]=%E4"), ['ä' => ['ä' => ['ä' => 'ä']]]);
diff --git a/test/it_cache.t b/test/it_cache.t
index 3e2fb0d..10f639d 100755
--- a/test/it_cache.t
+++ b/test/it_cache.t
@@ -3,29 +3,29 @@
# test array_based process cache
it_cache::p