function StringTest::testCheckPlain

Tests String::checkPlain().

@dataProvider providerCheckPlain

Parameters

string $text: The text to provide to String::checkPlain().

string $expected: The expected output from the function.

string $message: The message to provide as output for the test.

bool $ignorewarnings: Whether or not to ignore PHP 5.3+ invalid multibyte sequence warnings.

File

drupal/core/tests/Drupal/Tests/Component/Utility/StringTest.php, line 42
Contains \Drupal\Tests\Component\Utility\StringTest.

Class

StringTest
Tests string filtering.

Namespace

Drupal\Tests\Component\Utility

Code

function testCheckPlain($text, $expected, $message, $ignorewarnings = FALSE) {
  $result = $ignorewarnings ? @String::checkPlain($text) : String::checkPlain($text);
  $this
    ->assertEquals($expected, $result, $message);
}