function ExpectDeprecationTest::testDeprecatedExpectDeprecation

@covers ::expectDeprecation

@todo the expectedDeprecation annotation does not work if tests are marked skipped.

See also

https://github.com/symfony/symfony/pull/25757

File

core/tests/Drupal/Tests/ExpectDeprecationTest.php, line 43

Class

ExpectDeprecationTest
@coversDefaultClass <a href="/api/drupal/core%21tests%21Drupal%21Tests%21Traits%21ExpectDeprecationTrait.php/trait/ExpectDeprecationTrait/8.9.x" title="Adds the ability to dynamically set expected deprecation messages in tests." class="local">\Drupal\Tests\Traits\ExpectDeprecationTrait</a>

Namespace

Drupal\Tests

Code

public function testDeprecatedExpectDeprecation() {
    $this->addExpectedDeprecationMessage('ExpectDeprecationTrait::expectDeprecation is deprecated in drupal:8.8.5 and is removed from drupal:9.0.0. Use ::addExpectedDeprecationMessage() instead. See https://www.drupal.org/node/3106024');
    $this->expectDeprecation('Test deprecated expectDeprecation');
    @trigger_error('Test deprecated expectDeprecation', E_USER_DEPRECATED);
}

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