Hi,

When running the following code:

               $this->drupalPost('', array('mail' => 'user@domain.com', 'name' => 'user@domain.com'), t('Create new account'));

With this markup:

<input id="edit-name-1" type="hidden" value="" name="name"/>

I get the following error on "Test result":
Failed to set field name to user@domain.com

chx pointed out on #drupal-contribution that:
- it is already fixed in drupal 7 but not backported
- line 1653 should be case 'hidden' in dwtc.php

Let me know if you need more information.

Comments

proppy’s picture

A tentative workaround:

diff -r abf4a9a7698a usr/src/simpletest/drupal_web_test_case.php
--- a/usr/src/simpletest/drupal_web_test_case.php       Fri Nov 27 10:18:31 2009 +0100
+++ b/usr/src/simpletest/drupal_web_test_case.php       Fri Nov 27 10:18:40 2009 +0100
@@ -1645,6 +1645,7 @@
         switch ($type) {
           case 'text':
           case 'textarea':
+          case 'hidden':
           case 'password':
             $post[$name] = $edit[$name];
             unset($edit[$name]);
proppy’s picture

Status: Active » Closed (duplicate)