You are here

protected function ExpectDeprecationTrait::addExpectedDeprecationMessage in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php \Drupal\Tests\Traits\ExpectDeprecationTrait::addExpectedDeprecationMessage()

Sets an expected deprecation message.

Parameters

string $message: The expected deprecation message.

13 calls to ExpectDeprecationTrait::addExpectedDeprecationMessage()
ContentEntityBaseUnitTest::testLabel in core/tests/Drupal/Tests/Core/Entity/ContentEntityBaseUnitTest.php
@covers ::label
ContextAwarePluginBaseTest::testGetContextValue in core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php
@covers ::getContextValue @group legacy
ContextAwarePluginBaseTest::testSetContextValue in core/tests/Drupal/KernelTests/Core/Plugin/Context/ContextAwarePluginBaseTest.php
@covers ::setContextValue @group legacy
EntityUnitTest::testLabel in core/tests/Drupal/Tests/Core/Entity/EntityUnitTest.php
@covers ::label @group legacy
ExpectDeprecationTest::testDeprecatedExpectDeprecation in core/tests/Drupal/Tests/ExpectDeprecationTest.php
@covers ::expectDeprecation

... See full list

File

core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php, line 28

Class

ExpectDeprecationTrait
Adds the ability to dynamically set expected deprecation messages in tests.

Namespace

Drupal\Tests\Traits

Code

protected function addExpectedDeprecationMessage($message) {
  $this
    ->expectedDeprecations([
    $message,
  ]);
}