Index: modules/simpletest/drupal_web_test_case.php =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v retrieving revision 1.235 diff -u -p -r1.235 drupal_web_test_case.php --- modules/simpletest/drupal_web_test_case.php 19 Sep 2010 18:39:18 -0000 1.235 +++ modules/simpletest/drupal_web_test_case.php 20 Sep 2010 21:09:03 -0000 @@ -978,16 +978,18 @@ class DrupalWebTestCase extends DrupalTe } /** - * Create a user with a given set of permissions. The permissions correspond to the - * names given on the privileges page. + * Create a user with a given set of permissions. * * @param $permissions - * Array of permission names to assign to user. + * Array of permission names to assign to the user. Note that the user + * always has the default permissions derived from the + * "authenticated users" role. + * * @return * A fully loaded user object with pass_raw property, or FALSE if account * creation fails. */ - protected function drupalCreateUser($permissions = array('access comments', 'access content', 'post comments', 'post comments without approval')) { + protected function drupalCreateUser(array $permissions = array()) { // Create a role with the given permission set. if (!($rid = $this->drupalCreateRole($permissions))) { return FALSE; Index: modules/simpletest/tests/actions.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/actions.test,v retrieving revision 1.18 diff -u -p -r1.18 actions.test --- modules/simpletest/tests/actions.test 5 Aug 2010 23:53:38 -0000 1.18 +++ modules/simpletest/tests/actions.test 20 Sep 2010 21:12:50 -0000 @@ -67,11 +67,13 @@ class ActionsConfigurationTestCase exten /** * Test actions executing in a potential loop, and make sure they abort properly. */ -class ActionLoopTestCase extends DrupalWebTestCase { +class ActionsLoopTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( - 'name' => 'Actions executing in a potentially infinite loop', - 'description' => 'Tests actions executing in a loop, and makes sure they abort properly.', + 'name' => 'Actions infinite loop', + 'description' => 'Tests actions executing in an infinite loop, and makes sure they abort properly.', 'group' => 'Actions', ); } Index: modules/simpletest/tests/ajax_forms_test.module =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/ajax_forms_test.module,v retrieving revision 1.7 diff -u -p -r1.7 ajax_forms_test.module --- modules/simpletest/tests/ajax_forms_test.module 6 May 2010 05:59:31 -0000 1.7 +++ modules/simpletest/tests/ajax_forms_test.module 20 Sep 2010 21:12:50 -0000 @@ -38,7 +38,6 @@ function ajax_forms_test_menu() { * A basic form used to test form_state['values'] during callback. */ function ajax_forms_test_simple_form($form, &$form_state) { - $form = array(); $form['select'] = array( '#type' => 'select', '#options' => array( Index: modules/simpletest/tests/form.test =================================================================== RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v retrieving revision 1.67 diff -u -p -r1.67 form.test --- modules/simpletest/tests/form.test 19 Sep 2010 18:39:18 -0000 1.67 +++ modules/simpletest/tests/form.test 20 Sep 2010 21:10:42 -0000 @@ -7,17 +7,24 @@ */ class FormsTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Form element validation', + 'name' => 'Element validation', 'description' => 'Tests various form element validation mechanisms.', 'group' => 'Form API', ); } function setUp() { - parent::setUp('form_test'); + parent::setUp('form_test', 'file'); + + // Add a text format to get a full text format widget. + $format = new stdClass; + $format->name = 'Test format 1'; + filter_format_save($format); + user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array(filter_permission_name($format))); } /** @@ -309,16 +316,18 @@ class FormsTestCase extends DrupalWebTes * Test form alter hooks. */ class FormAlterTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( - 'name' => 'Form alter hooks', + 'name' => 'Alter hooks', 'description' => 'Tests hook_form_alter() and hook_form_FORM_ID_alter().', 'group' => 'Form API', ); } function setUp() { - parent::setUp('form_test'); + parent::setUp('form_test', 'block'); } /** @@ -343,6 +352,8 @@ class FormAlterTestCase extends DrupalWe * Test form validation handlers. */ class FormValidationTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( 'name' => 'Form validation handlers', @@ -423,10 +434,11 @@ class FormValidationTestCase extends Dru * Test form element labels, required markers and associated output. */ class FormsElementsLabelsTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Form element and label output test', + 'name' => 'Labels and markers', 'description' => 'Test form element labels, required markers and associated output.', 'group' => 'Form API', ); @@ -496,10 +508,11 @@ class FormsElementsLabelsTestCase extend * Test the tableselect form element for expected behavior. */ class FormsElementsTableSelectFunctionalTest extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Tableselect form element type test', + 'name' => 'Tableselect', 'description' => 'Test the tableselect element for expected behavior', 'group' => 'Form API', ); @@ -509,14 +522,11 @@ class FormsElementsTableSelectFunctional parent::setUp('form_test'); } - /** * Test the display of checkboxes when #multiple is TRUE. */ function testMultipleTrue() { - $this->drupalGet('form_test/tableselect/multiple-true'); - $this->assertNoText(t('Empty text.'), t('Empty text should not be displayed.')); // Test for the presence of the Select all rows tableheader. @@ -533,7 +543,6 @@ class FormsElementsTableSelectFunctional */ function testMultipleFalse() { $this->drupalGet('form_test/tableselect/multiple-false'); - $this->assertNoText(t('Empty text.'), t('Empty text should not be displayed.')); // Test for the absence of the Select all rows tableheader. @@ -557,9 +566,7 @@ class FormsElementsTableSelectFunctional * Test the submission of single and multiple values when #multiple is TRUE. */ function testMultipleTrueSubmit() { - // Test a submission with one checkbox checked. - $edit = array(); $edit['tableselect[row1]'] = TRUE; $this->drupalPost('form_test/tableselect/multiple-true', $edit, 'Submit'); @@ -575,7 +582,6 @@ class FormsElementsTableSelectFunctional $this->assertText(t('Submitted: row1 = row1'), t('Checked checkbox row1.')); $this->assertText(t('Submitted: row2 = 0'), t('Unchecked checkbox row2.')); $this->assertText(t('Submitted: row3 = row3'), t('Checked checkbox row3.')); - } /** @@ -607,14 +613,11 @@ class FormsElementsTableSelectFunctional $this->assertNoFieldByXPath('//th[@class="select-all"]', NULL, t('Do not display a "Select all" checkbox when #multiple is FALSE, even when #js_select is TRUE.')); } - /** * Test the whether the option checker gives an error on invalid tableselect values for checkboxes. */ function testMultipleTrueOptionchecker() { - list($header, $options) = _form_test_tableselect_get_data(); - $form['tableselect'] = array( '#type' => 'tableselect', '#header' => $header, @@ -631,14 +634,11 @@ class FormsElementsTableSelectFunctional } - /** * Test the whether the option checker gives an error on invalid tableselect values for radios. */ function testMultipleFalseOptionchecker() { - list($header, $options) = _form_test_tableselect_get_data(); - $form['tableselect'] = array( '#type' => 'tableselect', '#header' => $header, @@ -655,7 +655,6 @@ class FormsElementsTableSelectFunctional $this->assertTrue(isset($errors['tableselect']), t('Option checker disallows invalid values for radio buttons.')); } - /** * Helper function for the option check test to submit a form while collecting errors. * @@ -677,9 +676,7 @@ class FormsElementsTableSelectFunctional $form_state['input']['form_id'] = $form_id; drupal_prepare_form($form_id, $form, $form_state); - drupal_process_form($form_id, $form, $form_state); - $errors = form_get_errors(); // Clear errors and messages. @@ -690,7 +687,6 @@ class FormsElementsTableSelectFunctional // to allow the caller lowlevel access to the form. return array($form, $form_state, $errors); } - } /** @@ -703,11 +699,12 @@ class FormsElementsTableSelectFunctional * values aren't lost due to a wrong form rebuild. */ class FormsFormStorageTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Multistep form using form storage', - 'description' => 'Tests a multistep form using form storage and makes sure validation and caching works right.', + 'name' => 'Multistep form storage', + 'description' => 'Tests a multistep form using form storage and makes sure validation and caching works right.', 'group' => 'Form API', ); } @@ -853,9 +850,11 @@ class FormsFormStorageTestCase extends D * Test wrapper form callbacks. */ class FormsFormWrapperTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( - 'name' => 'Form wrapper callback', + 'name' => 'Wrapper callback', 'description' => 'Tests form wrapper callbacks to pass a prebuilt form to form builder functions.', 'group' => 'Form API', ); @@ -879,6 +878,8 @@ class FormsFormWrapperTestCase extends D * Test $form_state clearance. */ class FormStateValuesCleanTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; + public static function getInfo() { return array( 'name' => 'Form state values clearance', @@ -931,7 +932,7 @@ class FormStateValuesCleanTestCase exten class FormsRebuildTestCase extends DrupalWebTestCase { public static function getInfo() { return array( - 'name' => 'Form rebuilding', + 'name' => 'Rebuild', 'description' => 'Tests functionality of drupal_rebuild_form().', 'group' => 'Form API', ); @@ -1021,10 +1022,11 @@ class FormsRebuildTestCase extends Drupa * Test the programmatic form submission behavior. */ class FormsProgrammaticTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Programmatic form submissions', + 'name' => 'Programmed submissions', 'description' => 'Test the programmatic form submission behavior.', 'group' => 'Form API', ); @@ -1101,10 +1103,11 @@ class FormsProgrammaticTestCase extends * Test that FAPI correctly determines $form_state['triggering_element']. */ class FormsTriggeringElementTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Form triggering element determination', + 'name' => 'Triggering element', 'description' => 'Test the determination of $form_state[\'triggering_element\'].', 'group' => 'Form API', ); @@ -1265,10 +1268,11 @@ class FormsArbitraryRebuildTestCase exte * Tests form API file inclusion. */ class FormsFileInclusionTestCase extends DrupalWebTestCase { + protected $profile = 'testing'; public static function getInfo() { return array( - 'name' => 'Form API file inclusion', + 'name' => 'Include files', 'description' => 'Tests form API file inclusion.', 'group' => 'Form API', ); @@ -1279,17 +1283,14 @@ class FormsFileInclusionTestCase extends } /** - * Tests loading an include specified in hook_menu(). + * Tests form state file inclusion. */ function testLoadMenuInclude() { + // Verify loading an include specified in hook_menu(). $this->drupalPostAJAX('form-test/load-include-menu', array(), array('op' => t('Save')), 'system/ajax', array(), array(), 'form-test-load-include-menu'); $this->assertText('Submit callback called.'); - } - /** - * Tests loading a custom specified inlcude. - */ - function testLoadCustomInclude() { + // Verify loading a custom specified include. $this->drupalPost('form-test/load-include-custom', array(), t('Save')); $this->assertText('Submit callback called.'); }