diff --git a/core/modules/media/tests/src/Functional/MediaInstallTest.php b/core/modules/media/tests/src/Functional/MediaInstallTest.php index fbd6982..613a9a2 100644 --- a/core/modules/media/tests/src/Functional/MediaInstallTest.php +++ b/core/modules/media/tests/src/Functional/MediaInstallTest.php @@ -28,10 +28,20 @@ protected function setUp() { * Tests reinstalling after being uninstalled. */ public function testReinstallAfterUninstall() { + $page = $this->getSession()->getPage(); + $assert_session = $this->assertSession(); + // Uninstall the media module. $this->container->get('module_installer')->uninstall(['media'], FALSE); - // Install the media module. - $this->container->get('module_installer')->install(['media'], FALSE); + + // Install the media module again, through a test module that depends on it. + // Note: We use a test module because in 8.4 the media module is hidden. + // Once it gets exposed again, this can be simplified. + $this->drupalGet('/admin/modules'); + $page->checkField('modules[media_test_views][enable]'); + $page->pressButton('Install'); + $assert_session->pageTextContains('Some required modules must be enabled'); + $page->pressButton('Continue'); $this->assertSession()->pageTextNotContains('could not be moved/copied because a file by that name already exists in the destination directory'); }