function UninstallKernelTest::testUninstallMedia

Same name and namespace in other branches
  1. 8.9.x core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php \Drupal\Tests\system\Kernel\Installer\UninstallKernelTest::testUninstallMedia()
  2. 10 core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php \Drupal\Tests\system\Kernel\Installer\UninstallKernelTest::testUninstallMedia()
  3. 11.x core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php \Drupal\Tests\system\Kernel\Installer\UninstallKernelTest::testUninstallMedia()

Tests uninstalling media and file modules.

File

core/modules/system/tests/src/Kernel/Installer/UninstallKernelTest.php, line 44

Class

UninstallKernelTest
Tests the uninstallation of modules.

Namespace

Drupal\Tests\system\Kernel\Installer

Code

public function testUninstallMedia() {
  // Media creates a file field that is removed on uninstall, ensure that it
  // is fully deleted (as it is empty) and that file then can be uninstalled
  // as well.
  \Drupal::service('module_installer')->uninstall([
    'media',
  ]);
  \Drupal::service('module_installer')->uninstall([
    'file',
  ]);
}

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