Skip to content

Commit dfe3bae

Browse files
committed
Fix skip statement for error handler test
We do not require a specific version of PHP, we only require PHPUnit 5.1. Previously, the test might have been run with PHP 7.0 and PHPUnit 4.8.x and then failed instead of being skipped. PHPUnit 5.1 is required for the test to run successfully, PHPUnit 4.8.13 is required for PHPUnit_Runner_Version::series() and is included to run tests on PHP 5.5 and 5.4.
1 parent bbe6774 commit dfe3bae

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"php": ">=5.4.0"
88
},
99
"require-dev": {
10-
"phpunit/phpunit": "^4.8|^5.7",
10+
"phpunit/phpunit": "^4.8.13|^5.1",
1111
"jakub-onderka/php-parallel-lint": "^0.9.2",
1212
"jakub-onderka/php-console-highlighter": "^0.3.2"
1313
},

test/phpt/error_handler_007.phpt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
--TEST--
22
ErrorHandler::notify() fatals with a throwing error handler
33
--SKIPIF--
4-
<?php if (PHP_VERSION_ID < 50600) die("Skipped: PHPUnit 5.1 required to test for STDERR output."); ?>
4+
<?php
5+
6+
$series = PHPUnit_Runner_Version::series();
7+
list($major, $minor) = explode(".", $series);
8+
9+
if ($major < 5 || $major == 5 && $minor < 1) {
10+
die("Skipped: PHPUnit 5.1 required to test for STDERR output.");
11+
}
12+
13+
?>
514
--FILE--
615
<?php
716

0 commit comments

Comments
 (0)