function LocaleUpgradePathTestCase::testLocaleUpgradePathFallback

Test an upgrade with path-based (with fallback) negotiation.

File

modules/simpletest/tests/upgrade/upgrade.locale.test, line 74

Class

LocaleUpgradePathTestCase
Upgrade test for locale.module.

Code

public function testLocaleUpgradePathFallback() {
  if ($this->skipUpgradeTest) {
    return;
  }
  // LANGUAGE_NEGOTIATION_PATH.
  $this->variable_set('language_negotiation', 2);
  // Set the language of the admin user to English.
  db_update('users')->fields(array(
    'language' => 'en',
  ))
    ->condition('uid', 1)
    ->execute();
  $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
  // Both prefixes should be active.
  $this->assertPageInLanguage('fr', 'fr');
  $this->assertPageInLanguage('en', 'en');
  // The home page should be in the admin user language.
  $this->assertPageInLanguage('', 'en');
  // The language switcher block should be displayed.
  $this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.