diff --git a/core/tests/Drupal/Tests/ExpectDeprecationTest.php b/core/tests/Drupal/Tests/ExpectDeprecationTest.php new file mode 100644 index 0000000000..8ebf3b5a21 --- /dev/null +++ b/core/tests/Drupal/Tests/ExpectDeprecationTest.php @@ -0,0 +1,24 @@ +expectDeprecation('Test deprecation'); + @trigger_error('Test deprecation', E_USER_DEPRECATED); + } + +} diff --git a/core/tests/Drupal/Tests/SetExpectedDeprecationTest.php b/core/tests/Drupal/Tests/SetExpectedDeprecationTest.php deleted file mode 100644 index acefeca77f..0000000000 --- a/core/tests/Drupal/Tests/SetExpectedDeprecationTest.php +++ /dev/null @@ -1,24 +0,0 @@ -setExpectedDeprecation('Test deprecation'); - @trigger_error('Test deprecation', E_USER_DEPRECATED); - } - -} diff --git a/core/tests/Drupal/Tests/Traits/SetExpectedDeprecationTrait.php b/core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php similarity index 97% rename from core/tests/Drupal/Tests/Traits/SetExpectedDeprecationTrait.php rename to core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php index 42a8a0819f..279612e943 100644 --- a/core/tests/Drupal/Tests/Traits/SetExpectedDeprecationTrait.php +++ b/core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php @@ -14,7 +14,7 @@ * * @todo Remove once https://github.com/symfony/symfony/pull/25757 is resolved. */ -trait SetExpectedDeprecationTrait { +trait ExpectDeprecationTrait { /** * Sets an expected deprecation message. @@ -22,7 +22,7 @@ * @param string $msg * The expected deprecation message. */ - protected function setExpectedDeprecation($msg) { + protected function expectDeprecation($msg) { // Ensure the class or method is in the legacy group. if (class_exists('PHPUnit_Util_Test', FALSE)) { $test_util = 'PHPUnit_Util_Test'; @@ -38,7 +38,6 @@ protected function setExpectedDeprecation($msg) { } if ($trait = $this->getSymfonyTestListenerTrait()) { - // If setting an expected deprecation there is no need to be strict about // testing nothing as this is an assertion. $this->getTestResultObject()->beStrictAboutTestsThatDoNotTestAnything(FALSE);