FunctionTUnitTest.inc in Coder 8.2
File
coder_sniffer/Drupal/Test/Semantics/FunctionTUnitTest.inc
View source
<?php
$x = t('Test') . ': ' . $variable;
$x = '<p>' . t('Test') . '</p>';
$x = '(' . t('Test') . ')';
$x = '[' . t('Test') . ']';
$x = '- ' . t('Test') . ' -';
$x = '<' . t('Test') . '>';
$x = '«' . t('Test') . '»';
$x = '<p>' . t('Test') . '</p><p>More text.</p>';
$x = t('Test') . ' (disabled)';
class Test {
public function doSomething() {
return $this
->t('This string should avoid backslashes for \'');
}
public function doSomethingElse() {
return new TranslatableMarkup('Do not ' . 'concatenate');
}
public function doSomethingMore() {
return new TranslationWrapper(' Do not start with a space');
}
}