You are here

public function UnicodeTest::providerTestTruncateBytes in Drupal 8

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::providerTestTruncateBytes()
  2. 10 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::providerTestTruncateBytes()

Provides data for self::testTruncateBytes().

Return value

array An array of arrays, each containing the parameters to self::testTruncateBytes().

File

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

Class

UnicodeTest
Test unicode handling features implemented in Unicode component.

Namespace

Drupal\Tests\Component\Utility

Code

public function providerTestTruncateBytes() {
  return [
    // String shorter than max length.
    [
      'Short string',
      42,
      'Short string',
    ],
    // Simple string longer than max length.
    [
      'Longer string than previous.',
      10,
      'Longer str',
    ],
    // Unicode.
    [
      '以呂波耳・ほへとち。リヌルヲ。',
      10,
      '以呂波',
    ],
  ];
}