function UnicodeTest::testValidateUtf8

Same name in other branches
  1. 9 core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testValidateUtf8()
  2. 8.9.x core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testValidateUtf8()
  3. 11.x core/tests/Drupal/Tests/Component/Utility/UnicodeTest.php \Drupal\Tests\Component\Utility\UnicodeTest::testValidateUtf8()

Tests UTF-8 validation.

@dataProvider providerTestValidateUtf8 @covers ::validateUtf8

Parameters

string $text: The text to validate.

bool $expected: The expected return value from Unicode::validateUtf8().

string $message: The message to display on failure.

File

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

Class

UnicodeTest
Test unicode handling features implemented in Unicode component.

Namespace

Drupal\Tests\Component\Utility

Code

public function testValidateUtf8($text, $expected, $message) : void {
    $this->assertEquals($expected, Unicode::validateUtf8($text), $message);
}

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