LanguageListModuleInstallTest.php in Drupal 9
File
core/modules/language/tests/src/Functional/LanguageListModuleInstallTest.php
View source
<?php
namespace Drupal\Tests\language\Functional;
use Drupal\Tests\BrowserTestBase;
class LanguageListModuleInstallTest extends BrowserTestBase {
protected static $modules = [
'language_test',
];
protected $defaultTheme = 'stark';
public function testModuleInstallLanguageList() {
$admin_user = $this
->drupalCreateUser([
'access administration pages',
'administer modules',
]);
$this
->drupalLogin($admin_user);
$edit = [];
$edit['modules[language][enable]'] = 'language';
$this
->drupalGet('admin/modules');
$this
->submitForm($edit, 'Install');
$this
->assertEquals(1, \Drupal::state()
->get('language_test.language_count_preinstall', 0), 'Using LanguageManager::getLanguages() returns 1 language during Language installation.');
$this
->rebuildContainer();
$this
->assertTrue(\Drupal::moduleHandler()
->moduleExists('language'), 'Language module is enabled');
}
}