You are here

function CoderReviewUpgrade7xTest::testMultilingual7x in Coder 7.2

Same name and namespace in other branches
  1. 7 coder_review/tests/coder_review_7x.test \CoderReviewUpgrade7xTest::testMultilingual7x()

???

File

coder_review/tests/coder_review_7x.test, line 670

Class

CoderReviewUpgrade7xTest
???

Code

function testMultilingual7x() {

  // http://drupal.org/node/224333#locale_context
  $this
    ->assertCoderReviewFail("  t('Welcome to our site', array(), 'de');");
  $this
    ->assertCoderReviewFail('  t("Welcome to our site", array(), "de");');
  $this
    ->assertCoderReviewFail("  t('Welcome to our site', array('!code' => \$code, '!foo' => \$foo), 'de');");
  $this
    ->assertCoderReviewPass("  t('Welcome to our site');");
  $this
    ->assertCoderReviewPass("  t('Welcome to our site', array());");
  $this
    ->assertCoderReviewPass("  t('Welcome to our site', array('!code' => \$code, '!foo' => \$foo));");
  $this
    ->assertCoderReviewPass("  t('Welcome to our site', array(), array('langcode' => 'de'));");
  $this
    ->assertCoderReviewPass("  t('Welcome to our site', array('!code' => \$code, '!foo' => \$foo), array('langcode' => 'de'));");
  $this
    ->assertCoderReviewPass("  t('!user, welcome to our site', array('!user' => theme('username', \$user)), array('langcode' => 'de'));");
  $this
    ->assertCoderReviewFail("  format_plural(\$count, '1 comment', '@count comments', array(), 'de');");
  $this
    ->assertCoderReviewPass("  format_plural(\$count, '1 comment', '@count comments', array(), array('langcode' => 'de'));");
}