Skip to content

Commit 347e86c

Browse files
committed
Make tests run when installed via PEAR
pear run-tests -p console_getopt
1 parent 1222bf1 commit 347e86c

File tree

5 files changed

+13
-5
lines changed

5 files changed

+13
-5
lines changed

package.xml

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,15 @@ short and long options.</description>
4444

4545
<contents>
4646
<dir name="/">
47-
<file name="Console/Getopt.php" role="php" />
47+
<dir name="Console">
48+
<file name="Getopt.php" role="php" />
49+
</dir>
50+
<dir name="tests">
51+
<file role="test" name="001-getopt.phpt" />
52+
<file role="test" name="bug10557.phpt" />
53+
<file role="test" name="bug11068.phpt" />
54+
<file role="test" name="bug13140.phpt" />
55+
</dir>
4856
</dir>
4957
</contents>
5058

tests/001-getopt.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Console_Getopt
33
--FILE--
44
<?php
5-
require_once __DIR__ . '/../Console/Getopt.php';
5+
require_once 'Console/Getopt.php';
66
PEAR::setErrorHandling(PEAR_ERROR_PRINT, "%s\n\n");
77

88
function test($argstr, $optstr) {

tests/bug10557.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Console_Getopt [bug 10557]
55
<?php
66
$_SERVER['argv'] =
77
$argv = array('hi', '[email protected]', '--to', '--mailpack', '--debug');
8-
require_once __DIR__ . '/../Console/Getopt.php';
8+
require_once 'Console/Getopt.php';
99
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'f:t:',
1010
array('from=','to=','mailpack=','direction=','verbose','debug'));
1111
if(PEAR::isError($ret))

tests/bug11068.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Console_Getopt [bug 11068]
55
<?php
66
$_SERVER['argv'] =
77
$argv = array('hi', '[email protected]', '--to', 'hi', '-');
8-
require_once __DIR__ . '/../Console/Getopt.php';
8+
require_once 'Console/Getopt.php';
99
$ret = Console_Getopt::getopt(Console_Getopt::readPHPArgv(), 'f:t:',
1010
array('from=','to=','mailpack=','direction=','verbose','debug'));
1111
if(PEAR::isError($ret))

tests/bug13140.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Console_Getopt [bug 13140]
66
$_SERVER['argv'] = $argv =
77
array('--bob', '--foo' , '-bar', '--test', '-rq', 'thisshouldbehere');
88

9-
require_once __DIR__ . '/../Console/Getopt.php';
9+
require_once 'Console/Getopt.php';
1010
$cg = new Console_GetOpt();
1111

1212
print_r($cg->getopt2($cg->readPHPArgv(), 't', array('test'), true));

0 commit comments

Comments
 (0)