function StringTest::testFormat

Tests string formatting with String::format().

@dataProvider providerFormat

Parameters

string $string: The string to run through String::format().

string $args: The arguments to pass into String::format().

string $expected: The expected result from calling the function.

string $message: The message to display as output to the test.

See also

String::format()

File

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

Class

StringTest
Tests string filtering.

Namespace

Drupal\Tests\Component\Utility

Code

function testFormat($string, $args, $expected, $message) {
  $result = String::format($string, $args);
  $this
    ->assertEquals($expected, $result, $message);
}