From d987adefc85095f057c3d6d3eb2fa4c0d487d32b Mon Sep 17 00:00:00 2001 From: Urban Müller Date: Tue, 21 Apr 2020 01:03:53 +0200 Subject: use new array syntax --- test/getopt.t | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/getopt.t') 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'); -- cgit v1.2.3