function FormatStringTest::testFormatString

Tests error triggering on format_string.

@expectedDeprecation format_string() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Component\Render\FormattableMarkup instead. See https://www.drupal.org/node/2302363

File

core/tests/Drupal/KernelTests/Core/Bootstrap/FormatStringTest.php, line 21

Class

FormatStringTest
Tests deprecated behavior of format_string.

Namespace

Drupal\KernelTests\Core\Bootstrap

Code

public function testFormatString() {
    $markup = \format_string("Test", []);
    $this->assertInstanceOf(FormattableMarkup::class, $markup);
}

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