function ClassLoaderTest::testMultipleModules

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

Ensures the negative caches in the class loader don't result in crashes.

File

core/modules/system/tests/src/Functional/Module/ClassLoaderTest.php, line 91

Class

ClassLoaderTest
Tests class loading for modules.

Namespace

Drupal\Tests\system\Functional\Module

Code

public function testMultipleModules() : void {
    $this->drupalLogin($this->drupalCreateUser([
        'administer modules',
    ]));
    $edit = [
        "modules[module_install_class_loader_test1][enable]" => TRUE,
        "modules[module_install_class_loader_test2][enable]" => TRUE,
    ];
    $this->drupalGet('admin/modules');
    $this->submitForm($edit, 'Install');
    $this->rebuildContainer();
    $this->assertTrue(\Drupal::moduleHandler()->moduleExists('module_install_class_loader_test2'), 'The module_install_class_loader_test2 module has been installed.');
}

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