This repository was archived by the owner on May 13, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ final public function getCompatibleExceptionName($exceptionName)
4545 } else {
4646 if ($ exceptionName === 'ParseError ' ) {
4747 $ this ->getTestcase ()->markTestSkipped ('Parse errors can not be caught in PHP5 ' );
48+ } elseif ($ exceptionName === 'ArgumentCountError ' ) {
49+ // PHP 7.1 thrown when too few arguments are passed to a user-defined function or method.
50+ $ alternative = '\\PHPUnit_Framework_Error_Warning ' ;
51+
52+ $ matchingExceptionName = '\\PHPUnit \\Framework \\Error \\Warning ' ;
53+ if (class_exists ($ matchingExceptionName ) === false ) {
54+ $ matchingExceptionName = $ alternative ;
55+ }
4856 } else {
4957 $ exceptionName = $ this ->getMatchingExceptionName ($ exceptionName );
5058
@@ -84,8 +92,6 @@ private function isPhpUnitExceptionNeeded($exceptionName)
8492 private function getMatchingExceptionName ($ exceptionName )
8593 {
8694 $ matchingExceptions = array (
87- // PHP 7.1 thrown when too few arguments are passed to a user-defined function or method.
88- 'ArgumentCountError ' => '\PHPUnit_Framework_Error ' ,
8995 // PHP 7.0 thrown when an assertion made via assert() fails.
9096 'AssertionError ' => '\PHPUnit_Framework_Error_Warning ' ,
9197 // PHP 7.0 thrown when an attempt is made to divide a number by zero.
You can’t perform that action at this time.
0 commit comments