1 form.test | FormsArbitraryRebuildTestCase::testUserRegistrationMultipleField() |
Tests a rebuild caused by a multiple value field.
File
- core/
modules/ simpletest/ tests/ form.test, line 2196 - Unit tests for the Backdrop Form API.
Class
- FormsArbitraryRebuildTestCase
- Tests rebuilding of arbitrary forms by altering them.
Code
function testUserRegistrationMultipleField() {
$edit = array(
'name' => 'foo',
'mail' => 'bar@example.com',
);
$this->backdropPost('user/register', $edit, t('Add another'), 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.');
}