assertModuleConfig example

/** * Asserts that a module was successfully installed. * * @param string $name * Name of the module to check. * * @internal */
  protected function assertModuleSuccessfullyInstalled(string $name): void {
    $this->assertModules([$name], TRUE);
    $this->assertModuleTablesExist($name);
    $this->assertModuleConfig($name);
  }

  /** * Uninstalls a module and asserts that it was done correctly. * * @param string $module * The name of the module to uninstall. * @param string $package * (optional) The package of the module to uninstall. Defaults * to 'Core'. * * @internal */
|| $module->info[ExtensionLifecycle::LIFECYCLE_IDENTIFIER] === ExtensionLifecycle::DEPRECATED) {
        return FALSE;
      }
      return TRUE;
    });

    // Install every module possible.     \Drupal::service('module_installer')->install(array_keys($all_modules));

    $this->assertModules(array_keys($all_modules), TRUE);
    foreach ($all_modules as $module => $info) {
      $this->assertModuleConfig($module);
      $this->assertModuleTablesExist($module);
    }

    // Export active config to sync.     $this->copyConfig($this->container->get('config.storage')$this->container->get('config.storage.sync'));

    $this->resetAll();

    // Delete all entities provided by modules that prevent uninstallation. For     // example, if any content entity exists its provider cannot be uninstalled.     // So deleting all taxonomy terms allows the Taxonomy to be uninstalled.
Home | Imprint | This part of the site doesn't use cookies.