diff --git a/core/modules/simpletest/src/Form/SimpletestTestForm.php b/core/modules/simpletest/src/Form/SimpletestTestForm.php
index 92c8a54..be2709e 100644
--- a/core/modules/simpletest/src/Form/SimpletestTestForm.php
+++ b/core/modules/simpletest/src/Form/SimpletestTestForm.php
@@ -105,14 +105,16 @@ public function buildForm(array $form, FormStateInterface $form_state) {
 
     // Generate the list of tests arranged by group.
     $groups = simpletest_test_get_all();
+    // Ensure no id collisions.
+    $i = 0;
+
     foreach ($groups as $group => $tests) {
       $form['tests'][$group] = array(
         '#attributes' => array('class' => array('simpletest-group')),
       );
 
-      // 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)));
+      // Create an identifier for this test group.
+      $group_class = 'module-' . $i++;
 
       // Override tableselect column with custom selector for this group.
       // This group-select-all checkbox is injected via JavaScript.
