function ExpectDeprecationTrait::expectedDeprecations

Same name in other branches
  1. 8.9.x core/tests/Drupal/Tests/Traits/ExpectDeprecationTrait.php \Drupal\Tests\Traits\ExpectDeprecationTrait::expectedDeprecations()

Sets expected deprecation messages.

Parameters

string[] $messages: The expected deprecation messages.

See also

\Symfony\Bridge\PhpUnit\Legacy\ExpectDeprecationTraitForV8_4::expectDeprecation()

1 call to ExpectDeprecationTrait::expectedDeprecations()
ExpectDeprecationTest::testExpectDeprecationInIsolation in core/tests/Drupal/Tests/ExpectDeprecationTest.php
@covers ::addExpectedDeprecationMessage @runInSeparateProcess @preserveGlobalState disabled

File

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

Class

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

Namespace

Drupal\Tests\Traits

Code

public function expectedDeprecations(array $messages) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:9.1.0 and is removed from drupal:10.0.0. Use \\Symfony\\Bridge\\PhpUnit\\ExpectDeprecationTrait::expectDeprecation() instead. See https://www.drupal.org/node/3161901', E_USER_DEPRECATED);
    foreach ($messages as $message) {
        $this->expectDeprecation($message);
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.