installModules example

// Verify that default module config does not exist before installation yet.     $config = $this->config($default_config);
    $this->assertTrue($config->isNew());
    $config = $this->config($default_configuration_entity);
    $this->assertTrue($config->isNew());

    // Ensure that schema provided by modules that are not installed is not     // available.     $this->assertFalse(\Drupal::service('config.typed')->hasConfigSchema('config_schema_test.someschema'), 'Configuration schema for config_schema_test.someschema does not exist.');

    // Install the test module.     $this->installModules(['config_test']);

    // Verify that default module config exists.     \Drupal::configFactory()->reset($default_config);
    \Drupal::configFactory()->reset($default_configuration_entity);
    $config = $this->config($default_config);
    $this->assertFalse($config->isNew());
    $config = $this->config($default_configuration_entity);
    $this->assertFalse($config->isNew());

    // Verify that config_test API hooks were invoked for the dynamic default     // configuration entity.
Home | Imprint | This part of the site doesn't use cookies.