You are here

public function ExpectDeprecationTest::testExpectDeprecationInIsolation in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/ExpectDeprecationTest.php \Drupal\Tests\ExpectDeprecationTest::testExpectDeprecationInIsolation()

@covers ::addExpectedDeprecationMessage @runInSeparateProcess @preserveGlobalState disabled

File

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

Class

ExpectDeprecationTest
@coversDefaultClass \Drupal\Tests\Traits\ExpectDeprecationTrait

Namespace

Drupal\Tests

Code

public function testExpectDeprecationInIsolation() {
  $this
    ->expectDeprecation('Drupal\\Tests\\Traits\\ExpectDeprecationTrait::addExpectedDeprecationMessage() 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');
  $this
    ->expectDeprecation('Drupal\\Tests\\Traits\\ExpectDeprecationTrait::expectedDeprecations() 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');
  $this
    ->addExpectedDeprecationMessage('Test isolated deprecation');
  $this
    ->expectedDeprecations([
    'Test isolated deprecation2',
  ]);
  @trigger_error('Test isolated deprecation', E_USER_DEPRECATED);
  @trigger_error('Test isolated deprecation2', E_USER_DEPRECATED);
}