function InstallerNonEnglishProfileWithoutLocaleModuleTest::testNonEnglishProfileWithoutLocaleModule

Same name in other branches
  1. 9 core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php \Drupal\FunctionalTests\Installer\InstallerNonEnglishProfileWithoutLocaleModuleTest::testNonEnglishProfileWithoutLocaleModule()
  2. 8.9.x core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php \Drupal\FunctionalTests\Installer\InstallerNonEnglishProfileWithoutLocaleModuleTest::testNonEnglishProfileWithoutLocaleModule()
  3. 11.x core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php \Drupal\FunctionalTests\Installer\InstallerNonEnglishProfileWithoutLocaleModuleTest::testNonEnglishProfileWithoutLocaleModule()

Tests installing a profile with non-English language and no locale module.

File

core/tests/Drupal/FunctionalTests/Installer/InstallerNonEnglishProfileWithoutLocaleModuleTest.php, line 64

Class

InstallerNonEnglishProfileWithoutLocaleModuleTest
Tests installing a profile with non-English language and no locale module.

Namespace

Drupal\FunctionalTests\Installer

Code

public function testNonEnglishProfileWithoutLocaleModule() : void {
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->assertSession()
        ->addressEquals('user/1');
    // Confirm that we are logged-in after installation.
    $this->assertSession()
        ->pageTextContains($this->rootUser
        ->getAccountName());
    // Verify that the confirmation message appears.
    require_once $this->root . '/core/includes/install.inc';
    $this->assertSession()
        ->pageTextContains('Congratulations, you installed Drupal!');
    $this->assertFalse(\Drupal::service('module_handler')->moduleExists('locale'), 'The Locale module is not installed.');
    $this->assertTrue(\Drupal::service('module_handler')->moduleExists('language'), 'The Language module is installed.');
    $this->assertTrue(\Drupal::languageManager()->isMultilingual(), 'The language manager is multi-lingual.');
}

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