diff options
author | SVN Migration <svn@php.net> | 2003-02-27 17:43:39 +0000 |
---|---|---|
committer | SVN Migration <svn@php.net> | 2003-02-27 17:43:39 +0000 |
commit | 078bcec0997ad0e07b720c43cc9e6d0e046a75ab (patch) | |
tree | 36cb0f6be2ef078fe3374de8c087b93ecf82f812 /pear/Console/tests | |
parent | fd61f69077f6156ca71dde60ecfd9ed9765a02db (diff) | |
download | php-git-PHP-5.tar.gz |
This commit was manufactured by cvs2svn to create branch 'PHP_5'.PHP-5
Diffstat (limited to 'pear/Console/tests')
-rw-r--r-- | pear/Console/tests/001-getopt.phpt | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/pear/Console/tests/001-getopt.phpt b/pear/Console/tests/001-getopt.phpt deleted file mode 100644 index 3985dc9beb..0000000000 --- a/pear/Console/tests/001-getopt.phpt +++ /dev/null @@ -1,68 +0,0 @@ ---TEST-- -Console_Getopt ---SKIPIF-- -skip ---FILE-- -<?php - -error_reporting(E_ALL); -chdir(dirname(__FILE__)); -include "../Getopt.php"; -PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s\n\n"); - -function test($argstr, $optstr) { - $argv = split('[[:space:]]+', $argstr); - if (PEAR::isError($options = Console_Getopt::getopt($argv, $optstr))) { - return; - } - $opts = $options[0]; - $non_opts = $options[1]; - $i = 0; - print "options: "; - foreach ($opts as $o => $d) { - if ($i++ > 0) { - print ", "; - } - print $d[0] . '=' . $d[1]; - } - print "\n"; - print "params: " . implode(", ", $non_opts) . "\n"; - print "\n"; -} - -test("-abc", "abc"); -test("-abc foo", "abc"); -test("-abc foo", "abc:"); -test("-abc foo bar gazonk", "abc"); -test("-abc foo bar gazonk", "abc:"); -test("-a -b -c", "abc"); -test("-a -b -c", "abc:"); -test("-abc", "ab:c"); -test("-abc foo -bar gazonk", "abc"); -?> ---EXPECT-- -options: a=, b=, c= -params: - -options: a=, b=, c= -params: foo - -options: a=, b=, c=foo -params: - -options: a=, b=, c= -params: foo, bar, gazonk - -options: a=, b=, c=foo -params: bar, gazonk - -options: a=, b=, c= -params: - -Console_Getopt: option requires an argument -- c - -options: a=, b=c -params: - -options: a=, b=, c= -params: foo, -bar, gazonk |