public function LanguageUpgradePathTest::testLanguageUrlUpgrade

Tests language domain upgrade path.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Upgrade/LanguageUpgradePathTest.php, line 143
Definition of Drupal\system\Tests\Upgrade\LanguageUpgradePathTest.

Class

LanguageUpgradePathTest
Tests upgrading a filled database with language data.

Namespace

Drupal\system\Tests\Upgrade

Code

public function testLanguageUrlUpgrade() {
  $language_domain = 'ca.example.com';
  db_update('languages')
    ->fields(array(
    'domain' => 'http://' . $language_domain . ':8888',
  ))
    ->condition('language', 'ca')
    ->execute();
  $this
    ->variable_set('locale_language_negotiation_url_part', 1);
  $this
    ->assertTrue($this
    ->performUpgrade(), 'The upgrade was completed successfully.');
  language_negotiation_include();
  $domains = language_negotiation_url_domains();
  $this
    ->assertTrue($domains['ca'] == $language_domain, 'Language domain for Catalan properly upgraded.');
}