You are here

public function DefaultConfigTest::providerTestModuleConfig in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php \Drupal\KernelTests\Config\DefaultConfigTest::providerTestModuleConfig()

Test data provider for ::testModuleConfig().

Return value

array An array of module names to test.

File

core/tests/Drupal/KernelTests/Config/DefaultConfigTest.php, line 102
Contains \Drupal\KernelTests\Config\DefaultConfigTest.

Class

DefaultConfigTest
Tests that the installed config matches the default config.

Namespace

Drupal\KernelTests\Config

Code

public function providerTestModuleConfig() {
  $module_dirs = array_keys(iterator_to_array(new \FilesystemIterator(__DIR__ . '/../../../../modules/')));
  $module_names = array_map(function ($path) {
    return str_replace(__DIR__ . '/../../../../modules/', '', $path);
  }, $module_dirs);
  $modules_keyed = array_combine($module_names, $module_names);
  $data = array_map(function ($module) {
    return [
      $module,
    ];
  }, $modules_keyed);
  return $data;
}