From 10d5e7d9172390aa053cc4fde370012b9785d5ec Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sat, 6 Oct 2018 10:41:47 +0200 Subject: [PATCH] drop partial message support for expectedException annotation --- src/Util/Test.php | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) 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] );