public function ArbitraryRebuildTest::testUserRegistrationRebuild in Drupal 8
Same name and namespace in other branches
- 9 core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php \Drupal\Tests\system\Functional\Form\ArbitraryRebuildTest::testUserRegistrationRebuild()
Tests a basic rebuild with the user registration form.
File
- core/
modules/ system/ tests/ src/ Functional/ Form/ ArbitraryRebuildTest.php, line 57
Class
- ArbitraryRebuildTest
- Tests altering forms to be rebuilt so there are multiple steps.
Namespace
Drupal\Tests\system\Functional\FormCode
public function testUserRegistrationRebuild() {
$edit = [
'name' => 'foo',
'mail' => 'bar@example.com',
];
$this
->drupalPostForm('user/register', $edit, 'Rebuild');
$this
->assertText('Form rebuilt.');
$this
->assertFieldByName('name', 'foo', 'Entered username has been kept.');
$this
->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
}