You are here

public function UnicodeTest::testValidateUtf8 in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 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 475
Contains \Drupal\Tests\Component\Utility\UnicodeTest.

Class

UnicodeTest
Test unicode handling features implemented in Unicode component.

Namespace

Drupal\Tests\Component\Utility

Code

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