You are here

private static property PhpUnitWarnings::$deprecationWarnings in Drupal 10

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php \Drupal\Tests\Traits\PhpUnitWarnings::deprecationWarnings

Deprecation warnings from PHPUnit to raise with @trigger_error().

Add any PHPUnit deprecations that should be handled as deprecation warnings (rather than unconditional failures) for core and contrib.

Type: string[]

File

core/tests/Drupal/Tests/Traits/PhpUnitWarnings.php, line 23

Class

PhpUnitWarnings
Converts deprecation warnings added by PHPUnit to silenced deprecations.

Namespace

Drupal\Tests\Traits

Code

private static $deprecationWarnings = [
  // Warning for testing.
  'Test warning for \\Drupal\\Tests\\PhpUnitWarningsTest::testAddWarning()',
  // PHPUnit 9.
  'assertFileNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileDoesNotExist() instead.',
  'assertRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertMatchesRegularExpression() instead.',
  'assertNotRegExp() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDoesNotMatchRegularExpression() instead.',
  'assertDirectoryNotExists() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryDoesNotExist() instead.',
  'Support for using expectException() with PHPUnit\\Framework\\Error\\Warning is deprecated and will be removed in PHPUnit 10. Use expectWarning() instead.',
  'Support for using expectException() with PHPUnit\\Framework\\Error\\Error is deprecated and will be removed in PHPUnit 10. Use expectError() instead.',
  'assertDirectoryNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertDirectoryIsNotWritable() instead.',
  'assertFileNotIsWritable() is deprecated and will be removed in PHPUnit 10. Refactor your code to use assertFileIsNotWritable() instead.',
  'The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.',
];