You are here

public function LocaleUpgradePathTestCase::assertPageInLanguage in Drupal 7

Asserts that a page exists and is in the specified language.

4 calls to LocaleUpgradePathTestCase::assertPageInLanguage()
LocaleUpgradePathTestCase::testLocaleUpgrade in modules/simpletest/tests/upgrade/upgrade.locale.test
Test a successful upgrade (no negotiation).
LocaleUpgradePathTestCase::testLocaleUpgradeDomain in modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with domain-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradePathDefault in modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with path-based negotiation.
LocaleUpgradePathTestCase::testLocaleUpgradePathFallback in modules/simpletest/tests/upgrade/upgrade.locale.test
Test an upgrade with path-based (with fallback) negotiation.

File

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

Class

LocaleUpgradePathTestCase
Upgrade test for locale.module.

Code

public function assertPageInLanguage($path, $langcode) {
  if (isset($path)) {
    $this
      ->drupalGet($path);
  }
  if (!$this
    ->assertResponse(200)) {
    return FALSE;
  }
  if ($this
    ->parse()) {
    return $this
      ->assertIdentical($langcode, (string) $this->elements['xml:lang']);
  }
  else {
    return FALSE;
  }
}