function ArbitraryRebuildTest::testUserRegistrationMultipleField

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php \Drupal\Tests\system\Functional\Form\ArbitraryRebuildTest::testUserRegistrationMultipleField()
  2. 8.9.x core/modules/system/tests/src/Functional/Form/ArbitraryRebuildTest.php \Drupal\Tests\system\Functional\Form\ArbitraryRebuildTest::testUserRegistrationMultipleField()
  3. 10 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 77

Class

ArbitraryRebuildTest
Tests altering forms to be rebuilt so there are multiple steps.

Namespace

Drupal\Tests\system\Functional\Form

Code

public function testUserRegistrationMultipleField() : void {
    $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');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.