function LocaleUpgradePathTestCase::testLocaleUpgradePathDefault

Test an upgrade with path-based negotiation.

File

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

Class

LocaleUpgradePathTestCase
Upgrade test for locale.module.

Code

public function testLocaleUpgradePathDefault() {
    if ($this->skipUpgradeTest) {
        return;
    }
    // LANGUAGE_NEGOTIATION_PATH_DEFAULT.
    $this->variable_set('language_negotiation', 1);
    $this->assertTrue($this->performUpgrade(), 'The upgrade was completed successfully.');
    // The home page should be in French.
    $this->assertPageInLanguage('', 'fr');
    // The language switcher block should be displayed.
    $this->assertRaw('block-locale-language', 'The language switcher block is displayed.');
    // The French prefix should not be active because French is the default language.
    $this->drupalGet('fr');
    $this->assertResponse(404);
    // The English prefix should be active.
    $this->assertPageInLanguage('en', 'en');
}

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