You are here

public function UnicodeTest::testSubstr in Drupal 8

Tests multibyte substr.

@dataProvider providerSubstr @covers ::substr @group legacy @expectedDeprecation \Drupal\Component\Utility\Unicode::substr() is deprecated in Drupal 8.6.0 and will be removed before Drupal 9.0.0. Use mb_substr() instead. See https://www.drupal.org/node/2850048.

File

core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php, line 272

Class

UnicodeTest
Test unicode handling features implemented in Unicode component.

Namespace

Drupal\Tests\Component\Utility

Code

public function testSubstr($text, $start, $length, $expected) {
  $this
    ->assertEquals($expected, Unicode::substr($text, $start, $length));
}