You are here

public function ArbitraryRebuildTest::testUserRegistrationRebuild in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php \Drupal\Tests\system\Functional\Form\ArbitraryRebuildTest::testUserRegistrationRebuild()
  2. 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\Form

Code

public function testUserRegistrationRebuild() {
  $edit = [
    'name' => 'foo',
    'mail' => 'bar@example.com',
  ];
  $this
    ->drupalGet('user/register');
  $this
    ->submitForm($edit, 'Rebuild');
  $this
    ->assertSession()
    ->pageTextContains('Form rebuilt.');
  $this
    ->assertSession()
    ->fieldValueEquals('name', 'foo');
  $this
    ->assertSession()
    ->fieldValueEquals('mail', 'bar@example.com');
}