]> granicus.if.org Git - php/commitdiff
Added getopt() test.
authorIlia Alshanetsky <iliaa@php.net>
Wed, 11 Dec 2002 17:38:28 +0000 (17:38 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Wed, 11 Dec 2002 17:38:28 +0000 (17:38 +0000)
ext/standard/tests/general_functions/getopt.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/general_functions/getopt.phpt b/ext/standard/tests/general_functions/getopt.phpt
new file mode 100644 (file)
index 0000000..11ba702
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+getopt
+--ARGS--
+-v -h -d test -m 1234 -t -j
+--SKIPIF--
+<?php
+       if (!ini_get('register_argc_argv')) {
+               die("skip this test needs register_argc_argv to be enabled");
+       }
+?>
+--FILE--
+<?php
+       var_dump(getopt("d:m:j:vht"));
+?>
+--EXPECT--
+array(5) {
+  ["v"]=>
+  bool(false)
+  ["h"]=>
+  bool(false)
+  ["d"]=>
+  string(4) "test"
+  ["m"]=>
+  string(4) "1234"
+  ["t"]=>
+  bool(false)
+}