function DeprecationHandler::collectActualDeprecation

Collects an actual deprecation.

Tests will expect deprecations during the test execution; at the end of each test run, collected deprecations are checked against the expected ones.

Parameters

string $message: The actual deprecation message triggered via trigger_error().

2 calls to DeprecationHandler::collectActualDeprecation()
BootstrapErrorHandler::__invoke in core/tests/Drupal/TestTools/ErrorHandler/BootstrapErrorHandler.php
Executes when the object is called as a function.
TestErrorHandler::__invoke in core/tests/Drupal/TestTools/ErrorHandler/TestErrorHandler.php
Executes when the object is called as a function.

File

core/tests/Drupal/TestTools/Extension/DeprecationBridge/DeprecationHandler.php, line 182

Class

DeprecationHandler
Drupal's PHPUnit extension to manage code deprecation.

Namespace

Drupal\TestTools\Extension\DeprecationBridge

Code

public static function collectActualDeprecation(string $message) : void {
    if (!self::isEnabled()) {
        return;
    }
    self::$collectedDeprecations[] = $message;
}

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