function ExpectDeprecationTrait::expectDeprecation
Adds an expected deprecation.
Parameters
string $message: The expected deprecation message.
90 calls to ExpectDeprecationTrait::expectDeprecation()
- BackwardsCompatibilityClassLoaderTest::testModuleMovedClass in core/
tests/ Drupal/ KernelTests/ Core/ ClassLoader/ BackwardsCompatibilityClassLoaderTest.php - Tests that a moved class from a module works.
- BlockValidationTest::testWeightCannotBeNull in core/
modules/ block/ tests/ src/ Kernel/ BlockValidationTest.php - @group legacy
- CKEditor5PluginManagerTest::testDeprecatedIcons in core/
modules/ ckeditor5/ tests/ src/ Kernel/ CKEditor5PluginManagerTest.php - Tests deprecation and backwards compatibility of icon names.
- CKEditor5PluginManagerTest::testDerivedPluginDefinitions in core/
modules/ ckeditor5/ tests/ src/ Kernel/ CKEditor5PluginManagerTest.php - @covers \Drupal\ckeditor5\Plugin\CKEditor5PluginManager::getDiscovery[[api-linebreak]] @dataProvider providerTestDerivedPluginDefinitions @group legacy
- ConfigSchemaDeprecationTest::testConfigSchemaDeprecation in core/
tests/ Drupal/ KernelTests/ Core/ Config/ ConfigSchemaDeprecationTest.php - Tests config schema deprecation.
File
-
core/
tests/ Drupal/ TestTools/ Extension/ DeprecationBridge/ ExpectDeprecationTrait.php, line 83
Class
- ExpectDeprecationTrait
- A trait to include in Drupal tests to manage expected deprecations.
Namespace
Drupal\TestTools\Extension\DeprecationBridgeCode
public function expectDeprecation(string $message) : void {
if (!DeprecationHandler::isDeprecationTest($this)) {
throw new \RuntimeException('expectDeprecation() can only be called from tests marked with #[IgnoreDeprecations] or \'@group legacy\'');
}
if (!DeprecationHandler::isEnabled()) {
return;
}
DeprecationHandler::expectDeprecation($message);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.