/** * Tests installation and uninstallation. */ function testInstallationAndUninstallation() { /** @var \Drupal\Core\Extension\ModuleInstallerInterface $module_installer */ $module_installer = \Drupal::service('module_installer'); $module_handler = \Drupal::moduleHandler(); $this->assertTrue(Currency::load('XXX') instanceof CurrencyInterface); $this->assertTrue(CurrencyLocale::load('en_US') instanceof CurrencyLocaleInterface); $module_installer->uninstall(array('currency')); $this->assertFalse($module_handler->moduleExists('currency')); }