Skip to content

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

src/Extensions/PhptTestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
4343
'report_memleaks=0',
4444
'report_zend_debug=0',
4545
'safe_mode=0',
46-
'track_errors=1',
4746
'xdebug.default_enable=0'
4847
);
4948

src/Util/Getopt.php

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ public static function getopt(array $args, $short_options, $long_options = null)
3535
reset($args);
3636
array_map('trim', $args);
3737

38-
while (list($i, $arg) = each($args)) {
38+
while ($arg = current($args)) {
39+
$i = key($args);
40+
next($args);
41+
3942
if ($arg == '') {
4043
continue;
4144
}
@@ -94,8 +97,10 @@ protected static function parseShortOption($arg, $short_options, &$opts, &$args)
9497
if ($i + 1 < $argLen) {
9598
$opts[] = array($opt, substr($arg, $i + 1));
9699
break;
97-
} elseif (list(, $opt_arg) = each($args)) {
100+
} elseif ($opt_arg = current($args)) {
101+
next($args);
98102
} else {
103+
next($args);
99104
throw new PHPUnit_Framework_Exception(
100105
"option requires an argument -- $opt"
101106
);
@@ -139,11 +144,14 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args)
139144

140145
if (substr($long_opt, -1) == '=') {
141146
if (substr($long_opt, -2) != '==') {
142-
if (!strlen($opt_arg) &&
143-
!(list(, $opt_arg) = each($args))) {
144-
throw new PHPUnit_Framework_Exception(
145-
"option --$opt requires an argument"
146-
);
147+
if (!strlen($opt_arg)) {
148+
$opt_arg = current($args);
149+
next($args);
150+
if (!($opt_arg)) {
151+
throw new PHPUnit_Framework_Exception(
152+
"option --$opt requires an argument"
153+
);
154+
}
147155
}
148156
}
149157
} elseif ($opt_arg) {

0 commit comments

Comments
 (0)