Tests t() and format_string() replacement functionality.
function testFormatStringAndT() {
foreach (array(
'format_string',
't',
) as $function) {
$text = $function('Simple text');
$this
->assertEqual($text, 'Simple text', $function . ' leaves simple text alone.');
$text = $function('Escaped text: @value', array(
'@value' => '<script>',
));
$this
->assertEqual($text, 'Escaped text: <script>', $function . ' replaces and escapes string.');
$text = $function('Placeholder text: %value', array(
'%value' => '<script>',
));
$this
->assertEqual($text, 'Placeholder text: <em class="placeholder"><script></em>', $function . ' replaces, escapes and themes string.');
$text = $function('Verbatim text: !value', array(
'!value' => '<script>',
));
$this
->assertEqual($text, 'Verbatim text: <script>', $function . ' replaces verbatim string as-is.');
}
}