From d59a4921188753dbe4c0161081755a28112c3ef6 Mon Sep 17 00:00:00 2001 From: Nathan Gass Date: Thu, 22 Mar 2012 18:18:42 +0000 Subject: Branch itools/devel-utf8 created --- devel-utf8/tests/getopt.t | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100755 devel-utf8/tests/getopt.t (limited to 'devel-utf8/tests/getopt.t') diff --git a/devel-utf8/tests/getopt.t b/devel-utf8/tests/getopt.t new file mode 100755 index 0000000..7a84588 --- /dev/null +++ b/devel-utf8/tests/getopt.t @@ -0,0 +1,29 @@ +#!/www/server/bin/php -qC + "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); +} + +$_SERVER['argv'] = array('doesnotexist.php', '-0'); +$zero_opts = it::getopt($GLOBALS['usage']); +ok($zero_opts['zero'], '-0'); + -- cgit v1.2.3