class CoderI18NTest in Coder 6.2
Same name and namespace in other branches
- 6 tests/coder_i18n.test \CoderI18NTest
Hierarchy
- class \CoderTestCase extends \DrupalTestCase
- class \CoderI18NTest
Expanded class hierarchy of CoderI18NTest
File
- tests/
coder_i18n.test, line 10
View source
class CoderI18NTest extends CoderTestCase {
function __construct($id = NULL) {
parent::__construct('i18n', $id);
}
public static function getInfo() {
return array(
'name' => t('Coder I18N Tests'),
'description' => t('Tests for the coder I18N review.'),
'group' => t('Coder'),
);
}
function testI18NSpaces() {
$this
->assertCoderPass(' $var = t("Your rating");');
$this
->assertCoderFail(' $var = t(" Your rating");');
$this
->assertCoderFail(' $var = t("Your rating ");');
$this
->assertCoderPass(' $var = t("Your rating") ."hello ";');
$this
->assertCoderPass(' $var = t("Your rating") ." hello";');
$this
->assertCoderPass(" \$var = t('Your rating');");
$this
->assertCoderFail(" \$var = t(' Your rating');");
$this
->assertCoderFail(" \$var = t('Your rating ');");
$this
->assertCoderPass(" \$var = t('Your rating') .'hello ';");
$this
->assertCoderPass(" \$var = t('Your rating') .' hello';");
$this
->assertCoderPass(" 'titleUser' => t('Your rating') .': ',");
$this
->assertCoderFail(" \$var = t('This isn't a false positive ');");
$this
->assertCoderFail(" \$var = t('This isn\\'t a \"false\" positive ');");
$this
->assertCoderPass(" \$var = t('This is a false positive') . implode(', ', \$array);");
$this
->assertCoderPass(" \$var = t('This is a \\'false\\\" positive');");
$this
->assertCoderPass(" \$var = t('This is a \"false\" positive');");
$this
->assertCoderPass(" \$var = t('Your rating') . t('pass');");
$this
->assertCoderFail(" \$var = t('Your rating') . t(' fail');");
$this
->assertCoderFail(" \$var = t('Your rating') . t('fail ');");
$this
->assertCoderFail(" \$var = t('Your rating') . t(' fail ');");
$this
->assertCoderFail(" \$var = t(' Your rating ') . t(' fail ');");
$this
->assertCoderFail(" \$var = t(' Your rating') . t('fail');");
$this
->assertCoderFail(" \$var = t('Your rating ') . t('fail');");
$this
->assertCoderFail(" \$var = t(' Your rating ') . t('fail');");
$this
->assertCoderFail(" \$var = t('Your rating ') . t('fail ');");
$this
->assertCoderFail(" \$var = t(' Your rating ') . t('fail ');");
$this
->assertCoderFail(" \$var = t('Your rating ') . t(' fail');");
$this
->assertCoderFail(" \$description[] = t('until !until ', array('!until' => date_format_date(\$until, 'custom', \$format)));");
$this
->assertCoderFail(" \$description[] = t('except !dates ', array('!dates' => implode(', ', \$values)));");
}
function testExtraTs() {
$this
->assertCoderPass(" watchdog('name', 'Your message.');");
$this
->assertCoderFail(" watchdog('name', t('Your message.'));");
$this
->assertCoderFail(" watchdog('name', st('Your message.'));");
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CoderI18NTest:: |
public static | function | ||
CoderI18NTest:: |
function | |||
CoderI18NTest:: |
function | |||
CoderI18NTest:: |
function | |||
CoderTestCase:: |
function |