Commit 80ee826c authored by catch's avatar catch

Issue #2945306 by alexpott, dawehner: The new ModuleList in 8.6.x can discover...

Issue #2945306 by alexpott, dawehner: The new ModuleList in 8.6.x can discover modules in tests the previous code could not
parent 4f1df3fb
......@@ -135,6 +135,9 @@ function install_drupal($class_loader, $settings = []) {
$state = $install_state;
if (!empty($install_state['installation_finished'])) {
unset($GLOBALS['install_state']);
// If installation is finished ensure any further container rebuilds do not
// use the installer's service provider.
unset($GLOBALS['conf']['container_service_providers']['InstallerServiceProvider']);
}
// All available tasks for this page request are now complete. Interactive
......
......@@ -639,4 +639,13 @@ public function testGetDefaultDriveInstance() {
$this->assertEquals([NULL, ['key1' => ['key2' => ['key3' => 3, 'key3.1' => 3.1]]]], $this->minkDefaultDriverArgs);
}
/**
* Ensures we can't access modules we shouldn't be able to after install.
*/
public function testProfileModules() {
$this->setExpectedException(\InvalidArgumentException::class, 'The module demo_umami_content does not exist.');
$this->assertFileExists('core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml');
\Drupal::service('extension.list.module')->getPathname('demo_umami_content');
}
}
......@@ -306,4 +306,15 @@ protected function tearDown() {
}
}
/**
* Ensures KernelTestBase tests can access modules in profiles.
*/
public function testProfileModules() {
$this->assertFileExists('core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml');
$this->assertSame(
'core/profiles/demo_umami/modules/demo_umami_content/demo_umami_content.info.yml',
\Drupal::service('extension.list.module')->getPathname('demo_umami_content')
);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment