You are here

public function UninstallKernelTest::testUninstallMedia in Drupal 9

Same name and namespace in other branches
  1. 8 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',
  ]);
}