diff --git a/rules-tests/PHPUnit60/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector/Fixture/skip_expect_user_deprecation_message.php.inc b/rules-tests/PHPUnit60/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector/Fixture/skip_expect_user_deprecation_message.php.inc new file mode 100644 index 00000000..2988384c --- /dev/null +++ b/rules-tests/PHPUnit60/Rector/ClassMethod/AddDoesNotPerformAssertionToNonAssertingTestRector/Fixture/skip_expect_user_deprecation_message.php.inc @@ -0,0 +1,20 @@ +expectUserDeprecationMessage('Since foo 1.0: Bar is deprecated.'); + + @trigger_error('Since foo 1.0: Bar is deprecated.', E_USER_DEPRECATED); + } + + public function testExpectUserDeprecationMessageMatches() + { + $this->expectUserDeprecationMessageMatches('#^Since foo 1\.0#'); + + @trigger_error('Since foo 1.0: Bar is deprecated.', E_USER_DEPRECATED); + } +} diff --git a/src/NodeAnalyzer/AssertCallAnalyzer.php b/src/NodeAnalyzer/AssertCallAnalyzer.php index 02db1f97..b76e212c 100644 --- a/src/NodeAnalyzer/AssertCallAnalyzer.php +++ b/src/NodeAnalyzer/AssertCallAnalyzer.php @@ -36,6 +36,7 @@ final class AssertCallAnalyzer 'expectException', 'setExpectedException', 'expectOutput', + 'expectUserDeprecationMessage', 'should', ];