assertModuleTablesDoNotExist example

/** * Asserts that a module is not yet installed. * * @param string $name * Name of the module to check. * * @internal */
  protected function assertModuleNotInstalled(string $name): void {
    $this->assertModules([$name], FALSE);
    $this->assertModuleTablesDoNotExist($name);
  }

  /** * Asserts that a module was successfully installed. * * @param string $name * Name of the module to check. * * @internal */
  protected function assertModuleSuccessfullyInstalled(string $name): void {
    
$this->assertTrue(isset($modules_to_uninstall['comment']), 'The comment module will be disabled');
    $this->assertTrue(isset($modules_to_uninstall['file']), 'The File module will be disabled');
    $this->assertTrue(isset($modules_to_uninstall['editor']), 'The Editor module will be disabled');

    // Uninstall all modules that can be uninstalled.     \Drupal::service('module_installer')->uninstall(array_keys($modules_to_uninstall));

    $this->assertModules(array_keys($modules_to_uninstall), FALSE);
    foreach ($modules_to_uninstall as $module => $info) {
      $this->assertNoModuleConfig($module);
      $this->assertModuleTablesDoNotExist($module);
    }

    // Import the configuration thereby re-installing all the modules.     $this->drupalGet('admin/config/development/configuration');
    $this->submitForm([], 'Import all');
    // Modules have been installed that have services.     $this->rebuildContainer();

    // Check that there are no errors.     $this->assertSame([]$this->configImporter()->getErrors());

    
Home | Imprint | This part of the site doesn't use cookies.