Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/HtmlTest.php \Drupal\Tests\Component\Utility\HtmlTest::testDeprecations()

Test deprecations.

@group legacy

File

core/tests/Drupal/Tests/Component/Utility/HtmlTest.php, line 426

Class

HtmlTest
Tests \Drupal\Component\Utility\Html.

Namespace

Drupal\Tests\Component\Utility

Code

public function testDeprecations() : void {
  $this
    ->expectDeprecation('Passing NULL to Drupal\\Component\\Utility\\Html::decodeEntities is deprecated in drupal:9.5.0 and will trigger a PHP error from drupal:11.0.0. Pass a string instead. See https://www.drupal.org/node/3318826');
  $this
    ->assertSame('', Html::decodeEntities(NULL));
  $this
    ->expectDeprecation('Passing NULL to Drupal\\Component\\Utility\\Html::escape is deprecated in drupal:9.5.0 and will trigger a PHP error from drupal:11.0.0. Pass a string instead. See https://www.drupal.org/node/3318826');
  $this
    ->assertSame('', Html::escape(NULL));
}