- Issue created by @donquixote
- First commit to issue fork.
- 🇺🇸United States nicxvan
This shouldn't need tests, but maybe a phpcs rule to prevent more of these from getting in.
That would be a follow up probably.
Also needs to be a merge request.
In some places in core we call trigger_error(***, E_DEPRECATED).
When triggered, this results in:
ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED
core/tests/Drupal/Tests/BrowserTestBase.php
512: @trigger_error(__METHOD__ . 'is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no direct replacement. See https://www.drupal.org/node/3523039', E_DEPRECATED);
core/tests/Drupal/Tests/PerformanceData.php
341: @trigger_error(__METHOD__ . 'is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no direct replacement. See https://www.drupal.org/node/3511149', E_DEPRECATED);
368: @trigger_error(__METHOD__ . 'is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. There is no direct replacement. See https://www.drupal.org/node/3511149', E_DEPRECATED);
core/tests/Drupal/TestTools/ErrorHandler/BootstrapErrorHandler.php
59: if (E_USER_DEPRECATED === $errorNumber || E_DEPRECATED === $errorNumber) {
66: if ((E_USER_DEPRECATED === $errorNumber || E_DEPRECATED === $errorNumber) && DeprecationHandler::isIgnoredDeprecation($errorString)) {
core/tests/Drupal/TestTools/ErrorHandler/TestErrorHandler.php
62: if ((E_USER_DEPRECATED === $errorNumber || E_DEPRECATED === $errorNumber) && DeprecationHandler::isDeprecationTest($this->testCase)) {
core/includes/errors.inc
38: E_DEPRECATED => ['Deprecated function', RfcLogLevel::DEBUG],
Write a test like this and run it:
use Drupal\Tests\BrowserTestBase;
class MyTest extends BrowserTestBase {
public function test(): void {
$this->getOptions('My select');
}
}
(I think this will reproduce the problem even if 'My select' does not exist.)
Replace E_DEPRECATED with E_USER_DEPRECATED.
Find out why this has not popped up in tests before.
Are we not testing these deprecations?
Active
11.0 🔥
base system
This shouldn't need tests, but maybe a phpcs rule to prevent more of these from getting in.
That would be a follow up probably.
Also needs to be a merge request.