Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ php:
- 5.6
- "7.0"
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "nightly"

env:
matrix:
Expand Down Expand Up @@ -35,6 +39,8 @@ matrix:
- php: 5.5
dist: trusty
env: DEPENDENCIES="low"
allow_failures:
- php: nightly

dist: xenial
sudo: false
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"phpunit/phpunit-mock-objects": "~2.3",
"phpspec/prophecy": "^1.3.1",
"symfony/yaml": "~2.1|~3.0",
"sebastian/comparator": "~1.2.2",
"sebastian/comparator": "~1.2.4",
"sebastian/diff": "~1.2",
"sebastian/environment": "~1.3",
"sebastian/exporter": "~1.2",
Expand Down
1 change: 0 additions & 1 deletion src/Extensions/PhptTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class PHPUnit_Extensions_PhptTestCase implements PHPUnit_Framework_Test, PHPUnit
'report_memleaks=0',
'report_zend_debug=0',
'safe_mode=0',
'track_errors=1',
'xdebug.default_enable=0'
);

Expand Down
22 changes: 15 additions & 7 deletions src/Util/Getopt.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ public static function getopt(array $args, $short_options, $long_options = null)
reset($args);
array_map('trim', $args);

while (list($i, $arg) = each($args)) {
while ($arg = current($args)) {
$i = key($args);
next($args);

if ($arg == '') {
continue;
}
Expand Down Expand Up @@ -94,8 +97,10 @@ protected static function parseShortOption($arg, $short_options, &$opts, &$args)
if ($i + 1 < $argLen) {
$opts[] = array($opt, substr($arg, $i + 1));
break;
} elseif (list(, $opt_arg) = each($args)) {
} elseif ($opt_arg = current($args)) {
next($args);
} else {
next($args);
throw new PHPUnit_Framework_Exception(
"option requires an argument -- $opt"
);
Expand Down Expand Up @@ -139,11 +144,14 @@ protected static function parseLongOption($arg, $long_options, &$opts, &$args)

if (substr($long_opt, -1) == '=') {
if (substr($long_opt, -2) != '==') {
if (!strlen($opt_arg) &&
!(list(, $opt_arg) = each($args))) {
throw new PHPUnit_Framework_Exception(
"option --$opt requires an argument"
);
if (!strlen($opt_arg)) {
$opt_arg = current($args);
next($args);
if (!($opt_arg)) {
throw new PHPUnit_Framework_Exception(
"option --$opt requires an argument"
);
}
}
}
} elseif ($opt_arg) {
Expand Down