diff --git a/src/Util/Test.php b/src/Util/Test.php index 1e16bf18454..7949c23e085 100644 --- a/src/Util/Test.php +++ b/src/Util/Test.php @@ -33,7 +33,7 @@ class Test { const REGEX_DATA_PROVIDER = '/@dataProvider\s+([a-zA-Z0-9._:-\\\\x7f-\xff]+)/'; const REGEX_TEST_WITH = '/@testWith\s+/'; - const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)(?:[\t ]+(\S*))?(?:[\t ]+(\S*))?\s*$)m'; + const REGEX_EXPECTED_EXCEPTION = '(@expectedException\s+([:.\w\\\\x7f-\xff]+)\s*$)m'; const REGEX_REQUIRES_VERSION = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[<>=!]{0,2})\s*(?P[\d\.-]+(dev|(RC|alpha|beta)[\d\.])?)[ \t]*\r?$/m'; const REGEX_REQUIRES_VERSION_CONSTRAINT = '/@requires\s+(?PPHP(?:Unit)?)\s+(?P[\d\t -.|~^]+)[ \t]*\r?$/m'; const REGEX_REQUIRES_OS = '/@requires\s+(?POS(?:FAMILY)?)\s+(?P.+?)[ \t]*\r?$/m'; @@ -374,9 +374,7 @@ public static function getExpectedException($className, $methodName) $message = ''; $messageRegExp = ''; - if (isset($matches[2])) { - $message = \trim($matches[2]); - } elseif (isset($annotations['method']['expectedExceptionMessage'])) { + if (isset($annotations['method']['expectedExceptionMessage'])) { $message = self::parseAnnotationContent( $annotations['method']['expectedExceptionMessage'][0] ); @@ -388,9 +386,7 @@ public static function getExpectedException($className, $methodName) ); } - if (isset($matches[3])) { - $code = $matches[3]; - } elseif (isset($annotations['method']['expectedExceptionCode'])) { + if (isset($annotations['method']['expectedExceptionCode'])) { $code = self::parseAnnotationContent( $annotations['method']['expectedExceptionCode'][0] );