diff options
author | Urban Müller | 2020-04-21 01:03:53 +0200 |
---|---|---|
committer | Urban Müller | 2020-04-21 01:03:53 +0200 |
commit | d987adefc85095f057c3d6d3eb2fa4c0d487d32b (patch) | |
tree | 4a6f7be8e35ff0c412666c41a46f22383d8ed5c2 /test/getopt.t | |
parent | 1bd13e02d21ba01f38cd6df04de84b25a75a5264 (diff) | |
download | itools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.tar.gz itools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.tar.bz2 itools-d987adefc85095f057c3d6d3eb2fa4c0d487d32b.zip |
use new array syntax
Diffstat (limited to 'test/getopt.t')
-rwxr-xr-x | test/getopt.t | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/getopt.t b/test/getopt.t index 8b0ff70..cf3d9e8 100755 --- a/test/getopt.t +++ b/test/getopt.t @@ -12,17 +12,17 @@ $GLOBALS['usage'] = "Usage: doesnotexist.php [OPTIONS] function getopt_ok($argv, $exp, $name) { - $_SERVER['argv'] = array_merge(array('doesnotexist.php'), $argv); + $_SERVER['argv'] = array_merge(['doesnotexist.php'], $argv); $got = it::getopt($GLOBALS['usage']); return is($got['argument'], $exp, $name); } -foreach (array("" => "blah gnaber", " (umlaute)" => "pre üäpost") as $variant => $testarg) { - getopt_ok(array('-a', $testarg), $testarg, "Short version" . $variant); - getopt_ok(array('--argument', $testarg), $testarg, "Long version with space" . $variant); - getopt_ok(array("--argument=$testarg"), $testarg, "Long version with equal" . $variant); +foreach (["" => "blah gnaber", " (umlaute)" => "pre üäpost"] as $variant => $testarg) { + getopt_ok(['-a', $testarg], $testarg, "Short version" . $variant); + getopt_ok(['--argument', $testarg], $testarg, "Long version with space" . $variant); + getopt_ok(["--argument=$testarg"], $testarg, "Long version with equal" . $variant); } -$_SERVER['argv'] = array('doesnotexist.php', '-0'); +$_SERVER['argv'] = ['doesnotexist.php', '-0']; $zero_opts = it::getopt($GLOBALS['usage']); ok($zero_opts['zero'], '-0'); |