function TruncateDeprecateTest::testDeprecateViewsUiTruncate

Same name in other branches
  1. 10 core/modules/views_ui/tests/src/Kernel/TruncateDeprecateTest.php \Drupal\Tests\views_ui\Kernel\TruncateDeprecateTest::testDeprecateViewsUiTruncate()

Tests the deprecation of views_ui_truncate() replaced by Unicode::truncate.

@group legacy

File

core/modules/views_ui/tests/src/Kernel/TruncateDeprecateTest.php, line 26

Class

TruncateDeprecateTest
Tests the deprecation of views_ui_truncate() function.

Namespace

Drupal\Tests\views_ui\Kernel

Code

public function testDeprecateViewsUiTruncate() {
    $string = 'one two three four five six seven eight nine ten eleven twelve thirteen fourteen fifteen';
    $short_string = views_ui_truncate($string, 80);
    $this->expectDeprecation('views_ui_truncate() is deprecated in drupal:10.3.0 and is removed from drupal:12.0.0. Use \\Drupal\\Component\\Utility\\Unicode::truncate(). See https://www.drupal.org/node/3408283');
}

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