public function ArbitraryRebuildTest::testUserRegistrationMultipleField in Drupal 9
Same name and namespace in other branches
- 8 core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php \Drupal\Tests\system\Functional\Form\ArbitraryRebuildTest::testUserRegistrationMultipleField()
Tests a rebuild caused by a multiple value field.
File
- core/
modules/ system/ tests/ src/ Functional/ Form/ ArbitraryRebuildTest.php, line 72
Class
- ArbitraryRebuildTest
- Tests altering forms to be rebuilt so there are multiple steps.
Namespace
Drupal\Tests\system\Functional\FormCode
public function testUserRegistrationMultipleField() {
$edit = [
'name' => 'foo',
'mail' => 'bar@example.com',
];
$this
->drupalGet('user/register');
$this
->submitForm($edit, 'Add another item');
$this
->assertSession()
->pageTextContains('Test a multiple valued field');
$this
->assertSession()
->fieldValueEquals('name', 'foo');
$this
->assertSession()
->fieldValueEquals('mail', 'bar@example.com');
}