Tests a rebuild caused by a multiple value field.
function testUserRegistrationMultipleField() {
$edit = array(
'name' => 'foo',
'mail' => 'bar@example.com',
);
$this
->drupalPost('user/register', $edit, t('Add another item'), array(
'query' => array(
'field' => TRUE,
),
));
$this
->assertText('Test a multiple valued field', 'Form has been rebuilt.');
$this
->assertFieldByName('name', 'foo', 'Entered user name has been kept.');
$this
->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
}