function PhpUnitWarningsTest::testAddWarning

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/PhpUnitWarningsTest.php \Drupal\Tests\PhpUnitWarningsTest::testAddWarning()
  2. 10 core/tests/Drupal/Tests/PhpUnitWarningsTest.php \Drupal\Tests\PhpUnitWarningsTest::testAddWarning()

Tests that selected PHPUnit warning is converted to deprecation.

File

core/tests/Drupal/Tests/PhpUnitWarningsTest.php, line 16

Class

PhpUnitWarningsTest
@coversDefaultClass <a href="/api/drupal/core%21tests%21Drupal%21Tests%21Traits%21PhpUnitWarnings.php/trait/PhpUnitWarnings/11.x" title="Converts deprecation warnings added by PHPUnit to silenced deprecations." class="local">\Drupal\Tests\Traits\PhpUnitWarnings</a> @group legacy

Namespace

Drupal\Tests

Code

public function testAddWarning() {
    $this->expectDeprecation('Test warning for \\Drupal\\Tests\\PhpUnitWarningsTest::testAddWarning()');
    $this->addWarning('Test warning for \\Drupal\\Tests\\PhpUnitWarningsTest::testAddWarning()');
}

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