X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fmedia%2Ftests%2Fsrc%2FFunctional%2FMediaInstallTest.php;fp=web%2Fcore%2Fmodules%2Fmedia%2Ftests%2Fsrc%2FFunctional%2FMediaInstallTest.php;h=d13c3f06f3369bd14c8eb0c8a04501fee0dcd6d4;hp=0000000000000000000000000000000000000000;hb=9917807b03b64faf00f6a1f29dcb6eafc454efa5;hpb=aea91e65e895364e460983b890e295aa5d5540a5 diff --git a/web/core/modules/media/tests/src/Functional/MediaInstallTest.php b/web/core/modules/media/tests/src/Functional/MediaInstallTest.php new file mode 100644 index 000000000..d13c3f06f --- /dev/null +++ b/web/core/modules/media/tests/src/Functional/MediaInstallTest.php @@ -0,0 +1,49 @@ +drupalLogin($this->drupalCreateUser(['administer modules'])); + } + + /** + * 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 again, through a test module that depends on it. + // Note: We use a test module because in 8.4 the media module is hidden. + // @todo Simplify this in https://www.drupal.org/node/2897028 once it's + // shown again. + $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'); + } + +}