From 3c27efc4d5a1c85f07ab0c55db484941c983645f Mon Sep 17 00:00:00 2001
From: mmorris <mmorris@tombras.com>
Date: Fri, 24 Apr 2015 21:35:45 -0400
Subject: [PATCH] Prevent id dupes on
 http://www.drupal8.dev/admin/config/development/testing

---
 core/modules/simpletest/src/Form/SimpletestTestForm.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php
index 92c8a54..cc928ae 100644
--- a/core/modules/simpletest/src/Form/SimpletestTestForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php
@@ -105,6 +105,9 @@ public function buildForm(array $form, FormStateInterface $form_state) {
 
     // Generate the list of tests arranged by group.
     $groups = simpletest_test_get_all();
+    // Insure no id collisions
+    $i = 0;
+
     foreach ($groups as $group => $tests) {
       $form['tests'][$group] = array(
         '#attributes' => array('class' => array('simpletest-group')),
@@ -112,7 +115,7 @@ public function buildForm(array $form, FormStateInterface $form_state) {
 
       // Make the class name safe for output on the page by replacing all
       // non-word/decimal characters with a dash (-).
-      $group_class = 'module-' . strtolower(trim(preg_replace("/[^\w\d]/", "-", $group)));
+      $group_class = 'module-' . strtolower(trim(preg_replace("/[^\w\d]/", "-", $group))) . '-' . strval($i++);
 
       // Override tableselect column with custom selector for this group.
       // This group-select-all checkbox is injected via JavaScript.
-- 
1.8.4.2

