Chris@0: drupalLogin($this->drupalCreateUser(['administer modules'])); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Tests reinstalling after being uninstalled. Chris@0: */ Chris@0: public function testReinstallAfterUninstall() { Chris@0: $page = $this->getSession()->getPage(); Chris@0: $assert_session = $this->assertSession(); Chris@0: Chris@0: // Uninstall the media module. Chris@0: $this->container->get('module_installer')->uninstall(['media'], FALSE); Chris@0: Chris@0: // Install the media module again, through a test module that depends on it. Chris@0: // Note: We use a test module because in 8.4 the media module is hidden. Chris@0: // @todo Simplify this in https://www.drupal.org/node/2897028 once it's Chris@0: // shown again. Chris@0: $this->drupalGet('/admin/modules'); Chris@0: $page->checkField('modules[media_test_views][enable]'); Chris@0: $page->pressButton('Install'); Chris@0: $assert_session->pageTextContains('Some required modules must be enabled'); Chris@0: $page->pressButton('Continue'); Chris@0: $this->assertSession()->pageTextNotContains('could not be moved/copied because a file by that name already exists in the destination directory'); Chris@0: } Chris@0: Chris@0: }