Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / chi-teck / drupal-code-generator / templates / d7 / hook / registry_files_alter.twig
diff --git a/vendor/chi-teck/drupal-code-generator/templates/d7/hook/registry_files_alter.twig b/vendor/chi-teck/drupal-code-generator/templates/d7/hook/registry_files_alter.twig
new file mode 100644 (file)
index 0000000..fc4dc58
--- /dev/null
@@ -0,0 +1,17 @@
+/**
+ * Implements hook_registry_files_alter().
+ */
+function {{ machine_name }}_registry_files_alter(&$files, $modules) {
+  foreach ($modules as $module) {
+    // Only add test files for disabled modules, as enabled modules should
+    // already include any test files they provide.
+    if (!$module->status) {
+      $dir = $module->dir;
+      foreach ($module->info['files'] as $file) {
+        if (substr($file, -5) == '.test') {
+          $files["$dir/$file"] = array('module' => $module->name, 'weight' => $module->weight);
+        }
+      }
+    }
+  }
+}