Index: skinr.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr.module,v
retrieving revision 1.43
diff -u -p -r1.43 skinr.module
--- skinr.module	28 Jan 2011 19:35:28 -0000	1.43
+++ skinr.module	28 Jan 2011 23:36:24 -0000
@@ -949,7 +949,7 @@ function skinr_skin_info_process(&$skin_
       'title' => '',
       'type' => 'checkboxes',
       'description' => '',
-      'group' => '',
+      'group' => 'general',
       'theme hooks' => array('*'),
       'attached' => array(),
       'options' => array(),
@@ -1086,12 +1086,13 @@ function skinr_get_group_info() {
           $extension_info = $function();
           if (isset($extension_info) && is_array($extension_info)) {
             // Prepare the skin group information.
-            $extension_info += array(
-              'title' => '',
-              'description' => '',
-              'weight' => 0,
-            );
-
+            foreach ($extension_info as &$group) {
+              $group += array(
+                'title' => '',
+                'description' => '',
+                'weight' => 0,
+              );
+            }
             $group_info += $extension_info;
           }
         }
Index: skinr.skinr.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr.skinr.inc,v
retrieving revision 1.1
diff -u -p -r1.1 skinr.skinr.inc
--- skinr.skinr.inc	11 Jan 2011 00:54:20 -0000	1.1
+++ skinr.skinr.inc	28 Jan 2011 23:25:38 -0000
@@ -12,6 +12,30 @@
  */
 
 /**
+ * Implements hook_skinr_group_info().
+ */
+function skinr_skinr_group_info() {
+  $groups['general'] = array(
+    'title' => t('General'),
+    'description' => t('Styles for content such as lists, buttons, margins, padding, etc.'),
+    'weight' => -10,
+  );
+  $groups['box'] = array(
+    'title' => t('Box styles'),
+    'description' => t('Presentational styles for the container.'),
+  );
+  $groups['typography'] = array(
+    'title' => t('Typography'),
+    'description' => t('Fonts, styles, sizes and other typography related skins.'),
+  );
+  $groups['layout'] = array(
+    'title' => t('Layout'),
+    'description' => t('Grid, layout and other structural related skins.'),
+  );
+  return $groups;
+}
+
+/**
  * Implementation of hook_skinr_config_info().
  */
 function skinr_skinr_config_info() {
Index: skinr_ui.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/skinr_ui.admin.inc,v
retrieving revision 1.23
diff -u -p -r1.23 skinr_ui.admin.inc
--- skinr_ui.admin.inc	28 Jan 2011 19:35:29 -0000	1.23
+++ skinr_ui.admin.inc	28 Jan 2011 22:30:25 -0000
@@ -427,6 +427,7 @@ function skinr_ui_admin_skin_infos($form
     );
     return $form;
   }
+  $groups = skinr_get_group_info();
 
   uasort($skins, 'skinr_ui_sort_by_title');
   $form['skins'] = array('#tree' => TRUE);
@@ -444,14 +445,15 @@ function skinr_ui_admin_skin_infos($form
     );
 
     // Create a row entry for this skin.
-    $form['skins'][$skin['group']][$name] = _skinr_ui_admin_skin_infos_build_row($skin, $extra);
+    $group = $groups[$skin['group']]['title'];
+    $form['skins'][$group][$name] = _skinr_ui_admin_skin_infos_build_row($skin, $extra);
   }
 
   // Add basic information to the fieldsets.
   foreach (element_children($form['skins']) as $package) {
     $form['skins'][$package] += array(
       '#type' => 'fieldset',
-      '#title' => t($package),
+      '#title' => $package,
       '#collapsible' => TRUE,
       '#theme' => 'skinr_ui_admin_skin_infos_fieldset',
       '#header' => array(
Index: skins/default.inc
===================================================================
RCS file: skins/default.inc
diff -N skins/default.inc
--- skins/default.inc	10 Jan 2011 04:11:12 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,30 +0,0 @@
-<?php
-// $Id$
-
-/**
- * @file
- * Default group implementation.
- */
-
-/**
- * Implements hook_skinr_group_PLUGIN_info().
- */
-function skinr_skinr_group_default_info() {
-  $groups['general'] = array(
-    'title' => t('General'),
-    'description' => t('Styles for content such as lists, buttons, margins, padding, etc.'),
-  );
-  $groups['box'] = array(
-    'title' => t('Box styles'),
-    'description' => t('Presentational styles for the container.'),
-  );
-  $groups['typography'] = array(
-    'title' => t('Typography'),
-    'description' => t('Fonts, styles, sizes and other typography related skins.'),
-  );
-  $groups['layout'] = array(
-    'title' => t('Layout'),
-    'description' => t('Grid, layout and other structural related skins.'),
-  );
-  return $groups;
-}
Index: tests/skinr.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/tests/skinr.test,v
retrieving revision 1.11
diff -u -p -r1.11 skinr.test
--- tests/skinr.test	28 Jan 2011 19:35:30 -0000	1.11
+++ tests/skinr.test	28 Jan 2011 23:38:15 -0000
@@ -220,6 +220,48 @@ class SkinrApiTestCase extends DrupalWeb
     )));
   }
 
+
+  /**
+   * Tests hook_skinr_group_info().
+   */
+  function testSkinrGroupInfo() {
+    $group_info = skinr_get_group_info();
+
+    // Verify that default skin groups are found.
+    $all_expected = array(
+      'general' => array(
+        'title' => t('General'),
+        'weight' => -10,
+      ),
+      'box' => array(
+        'title' => t('Box styles'),
+      ),
+      'typography' => array(
+        'title' => t('Typography'),
+      ),
+      'layout' => array(
+        'title' => t('Layout'),
+      ),
+    );
+    foreach ($all_expected as $name => $expected) {
+      // We don't want to be pixel-perfect here.
+      if (isset($group_info[$name]['description'])) {
+        $expected['description'] = $group_info[$name]['description'];
+      }
+      $expected += array(
+        'description' => '',
+        'weight' => 0,
+      );
+      $this->assertEqual($group_info[$name], $expected, t('Group %group found:<pre>@data</pre>', array(
+        '%group' => $name,
+        '@data' => var_export($group_info[$name], TRUE),
+      )));
+      unset($group_info[$name]);
+    }
+    // After asserting all expected, the list of extensions should be empty.
+    $this->assertTrue(empty($group_info), 'No unexpected groups found.');
+  }
+
   /**
    * Tests hook_skinr_config_info().
    */
Index: tests/skinr_ui.test
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/skinr/tests/skinr_ui.test,v
retrieving revision 1.2
diff -u -p -r1.2 skinr_ui.test
--- tests/skinr_ui.test	28 Jan 2011 19:35:30 -0000	1.2
+++ tests/skinr_ui.test	29 Jan 2011 01:05:21 -0000
@@ -7,22 +7,11 @@
  */
 
 /**
- * Tests UI functionality.
- *
- * @todo Rename and split this test case into several ones, once we have a
- *   certain amount of tests and an idea of how to structure them.
+ * Base class for Skinr UI tests.
  */
-class SkinrUIBasicTestCase extends DrupalWebTestCase {
+class SkinrUITestCase extends DrupalWebTestCase {
   protected $profile = 'testing';
 
-  public static function getInfo() {
-    return array(
-      'name' => 'UI',
-      'description' => 'Tests Skinr UI functionality.',
-      'group' => 'Skinr',
-    );
-  }
-
   function setUp() {
     parent::setUp(array('block', 'contextual', 'skinr_test', 'skinr_ui'));
 
@@ -63,6 +52,23 @@ class SkinrUIBasicTestCase extends Drupa
         'pages' => '',
       ))
       ->execute();
+
+    // Enable Garland and skinr_test_subtheme without enabling its base theme in
+    // order to test subtheme inheritance functionality.
+    theme_enable(array('garland', 'skinr_test_subtheme'));
+  }
+}
+
+/**
+ * Tests UI functionality.
+ */
+class SkinrUIBasicTestCase extends SkinrUITestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'UI',
+      'description' => 'Tests basic Skinr UI functionality.',
+      'group' => 'Skinr',
+    );
   }
 
   /**
@@ -120,18 +126,45 @@ class SkinrUIBasicTestCase extends Drupa
     $class = (string) $elements[0]['class'];
     $this->assertTrue(strpos($class, ' font-1 '), 'CSS class of configured skin option found.');
   }
+}
+
+/**
+ * Tests administrative pages functionality.
+ */
+class SkinrUIAdminTestCase extends SkinrUITestCase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Administration',
+      'description' => 'Tests administrative Skinr UI functionality.',
+      'group' => 'Skinr',
+    );
+  }
+
+  function setUp() {
+    parent::setUp(array('skinr_test', 'skinr_ui'));
+
+    $this->admin_user = $this->drupalCreateUser(array(
+      'administer skinr',
+      'edit skin settings',
+      'edit advanced skin settings',
+    ));
+    $this->drupalLogin($this->admin_user);
+
+    // Enable Garland and skinr_test_subtheme without enabling its base theme in
+    // order to test subtheme inheritance functionality.
+    theme_enable(array('garland', 'skinr_test_subtheme'));
+  }
 
   /**
    * Tests default status of skins.
    *
+   * The skinr_test_basetheme skin defined by the skinr_test_basetheme theme
+   * specifies a default status for itself. Its subtheme should inherit the
+   * status of the basetheme.
+   *
    * @todo Add assertions for 'default status' itself.
    */
-  function testSkinAdminDefaultStatus() {
-    // The skinr_test_basetheme skin defined by the skinr_test_basetheme theme
-    // specifies a default status for itself. Enable its subtheme (only) to test
-    // that the status of the basetheme is inherited to the subtheme.
-    theme_enable(array('garland', 'skinr_test_subtheme'));
-
+  function testSkinDefaultStatus() {
     // Verify that the skin appears on the skin overview page.
     $this->drupalGet('admin/appearance/skinr/skins');
     $this->assertLinkByHref('admin/appearance/skinr/skins/settings/skinr_test_basetheme');
@@ -143,4 +176,25 @@ class SkinrUIBasicTestCase extends Drupa
     $this->assertNoFieldChecked('edit-skins-bartik-skinr-test-basetheme-enable', 'skinr_test_basetheme skin is disabled for Bartik.');
     $this->assertNoFieldChecked('edit-skins-garland-skinr-test-basetheme-enable', 'skinr_test_basetheme skin is disabled for Garland.');
   }
+
+  /**
+   * Tests skin group functionality.
+   */
+  function testSkinGroups() {
+    $this->drupalGet('admin/appearance/skinr/skins');
+
+    // Verify that the 'Default' group appears.
+    // @todo Make this work.
+    /*
+    $elements = $this->xpath('//fieldset[@id=:id]/legend::descendant/*[contains(text(), :title)]', array(
+      ':id' => 'edit-skins-general',
+      ':title' => t('General'),
+    ));
+    */
+    $this->assertText(t('General'));
+
+    // Verify that the 'Typography' group appears, since skinr_test module
+    // registers a skin in that group.
+    $this->assertText(t('Typography'));
+  }
 }
