function MediaInstallTest::testReinstallAfterUninstall

Same name in other branches
  1. 9 core/modules/media/tests/src/Functional/MediaInstallTest.php \Drupal\Tests\media\Functional\MediaInstallTest::testReinstallAfterUninstall()
  2. 8.9.x core/modules/media/tests/src/Functional/MediaInstallTest.php \Drupal\Tests\media\Functional\MediaInstallTest::testReinstallAfterUninstall()
  3. 11.x core/modules/media/tests/src/Functional/MediaInstallTest.php \Drupal\Tests\media\Functional\MediaInstallTest::testReinstallAfterUninstall()

Tests reinstalling after being uninstalled.

File

core/modules/media/tests/src/Functional/MediaInstallTest.php, line 37

Class

MediaInstallTest
Tests media Install / Uninstall logic.

Namespace

Drupal\Tests\media\Functional

Code

public function testReinstallAfterUninstall() : void {
    $page = $this->getSession()
        ->getPage();
    $assert_session = $this->assertSession();
    // Uninstall the media module.
    $this->container
        ->get('module_installer')
        ->uninstall([
        'media',
    ], FALSE);
    $this->drupalGet('/admin/modules');
    $page->checkField('modules[media][enable]');
    $page->pressButton('Install');
    $assert_session->pageTextNotContains('could not be moved/copied because a file by that name already exists in the destination directory');
    $assert_session->pageTextContains('Module Media has been installed');
}

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