mirror of
https://github.com/php/php-src.git
synced 2025-08-18 23:18:56 +02:00
Added getopt() test.
This commit is contained in:
parent
30f83207fe
commit
c194d9333d
1 changed files with 27 additions and 0 deletions
27
ext/standard/tests/general_functions/getopt.phpt
Normal file
27
ext/standard/tests/general_functions/getopt.phpt
Normal file
|
@ -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)
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue