function StringTest::providerFormat

Data provider for testFormat().

See also

testFormat()

File

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

Class

StringTest
Tests string filtering.

Namespace

Drupal\Tests\Component\Utility

Code

function providerFormat() {
  $tests[] = array(
    'Simple text',
    array(),
    'Simple text',
    'String::format leaves simple text alone.',
  );
  $tests[] = array(
    'Escaped text: @value',
    array(
      '@value' => '<script>',
    ),
    'Escaped text: &lt;script&gt;',
    'String::format replaces and escapes string.',
  );
  $tests[] = array(
    'Placeholder text: %value',
    array(
      '%value' => '<script>',
    ),
    'Placeholder text: <em class="placeholder">&lt;script&gt;</em>',
    'String::format replaces, escapes and themes string.',
  );
  $tests[] = array(
    'Verbatim text: !value',
    array(
      '!value' => '<script>',
    ),
    'Verbatim text: <script>',
    'String::format replaces verbatim string as-is.',
  );
  return $tests;
}