function InstallTest::testEnableUserTwice

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testEnableUserTwice()
  2. 8.9.x core/modules/system/tests/src/Functional/Module/InstallTest.php \Drupal\Tests\system\Functional\Module\InstallTest::testEnableUserTwice()
  3. 11.x core/modules/system/tests/src/Kernel/Module/InstallTest.php \Drupal\Tests\system\Kernel\Module\InstallTest::testEnableUserTwice()

Tests enabling User module once more.

Regression: The installer might enable a module twice due to automatic dependency resolution. A bug caused the stored weight for user.module to be an array.

File

core/modules/system/tests/src/Kernel/Module/InstallTest.php, line 56

Class

InstallTest
Tests the installation of modules.

Namespace

Drupal\Tests\system\Kernel\Module

Code

public function testEnableUserTwice() : void {
    $this->moduleInstaller
        ->install([
        'user',
    ], FALSE);
    $this->assertSame(0, $this->config('core.extension')
        ->get('module.user'));
    // To avoid false positives, ensure that a module that does not exist does
    // not return exactly zero.
    $this->assertNotSame(0, $this->config('core.extension')
        ->get('module.does_not_exist'));
}

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