Index: contributions/modules/simpletest/tests/form_inc.test
===================================================================
RCS file: contributions/modules/simpletest/tests/form_inc.test
diff -N contributions/modules/simpletest/tests/form_inc.test
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ contributions/modules/simpletest/tests/form_inc.test	7 Mar 2008 18:17:13 -0000
@@ -0,0 +1,60 @@
+<?php
+// $Id$
+
+class FormIncThemeTestCase extends DrupalTestCase {
+  
+  /**
+   * Implementation of get_info() for information
+   */
+  function get_info() {
+    return array(
+      'name' => t('Form.inc Themeing functions'),
+      'desc' => t('Test to make sure that the results of the various theme_* functions are correct'),
+      'group' => 'Form.inc Tests',
+    );
+  }
+  
+  function _get_empty_form() {
+    return array('#post' => NULL, '#programmed' => FALSE, '#tree' => FALSE);
+  }
+  
+  function _get_form_state() {
+    return array('storage' => NULL, 'submitted' => FALSE, 'post' => NULL, 'redirect' => NULL);
+  }
+  
+  function test_theme_button() {
+    $name = 'Basic button';
+    $form_id = 'test_theme_button';
+    $expected = '<input type="submit" name="op" id="edit-button" value="Button"  class="form-submit" />';
+    $form = $this->_get_empty_form();
+    $form_state = $this->_get_form_state();
+    
+    $form['button'] = array(
+      '#type' => 'button',
+      '#value' => 'Button',
+    );
+    $form = form_builder($form_id, $form, $form_state);
+    $result = drupal_render($form);
+
+    $this->assertEqual(trim($expected), trim($result), $name);
+  }
+  
+  function test_theme_checkbox() {
+    $name = 'Basic checkbox';
+    $form_id = 'test_theme_checkbox';
+    $expected = '<div class="form-item" id="edit-checkbox-wrapper">
+ <label class="option"><input type="checkbox" name="checkbox" id="edit-checkbox" value="1"   class="form-checkbox" /> Checkbox</label>
+</div>';
+    $form = $this->_get_empty_form();
+    $form_state = $this->_get_form_state();
+    
+    $form['checkbox'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Checkbox'),
+    );
+    $form = form_builder($form_id, $form, $form_state);
+    $result = drupal_render($form);
+
+    $this->assertEqual(trim($expected), trim($result), $name);
+  }
+}
