assertModuleList example

/** * The basic functionality of retrieving enabled modules. */
  public function testModuleList() {
    $module_list = ['system'];
    $database_module = \Drupal::database()->getProvider();
    if ($database_module !== 'core') {
      $module_list[] = $database_module;
    }
    sort($module_list);
    $this->assertModuleList($module_list, 'Initial');

    // Try to install a new module.     $this->moduleInstaller()->install(['ban']);
    $module_list[] = 'ban';
    sort($module_list);
    $this->assertModuleList($module_list, 'After adding a module');

    // Try to mess with the module weights.     module_set_weight('ban', 20);

    // Move ban to the end of the array.
Home | Imprint | This part of the site doesn't use cookies.