function ArbitraryRebuildTest::testUserRegistrationRebuild

Tests a basic rebuild with the user registration form.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Form/ArbitraryRebuildTest.php, line 61
Definition of Drupal\system\Tests\Form\ArbitraryRebuildTest.

Class

ArbitraryRebuildTest
Tests rebuilding of arbitrary forms by altering them.

Namespace

Drupal\system\Tests\Form

Code

function testUserRegistrationRebuild() {
  $edit = array(
    'name' => 'foo',
    'mail' => 'bar@example.com',
  );
  $this
    ->drupalPost('user/register', $edit, 'Rebuild');
  $this
    ->assertText('Form rebuilt.');
  $this
    ->assertFieldByName('name', 'foo', 'Entered user name has been kept.');
  $this
    ->assertFieldByName('mail', 'bar@example.com', 'Entered mail address has been kept.');
}