function UserAccountFormFieldsTest::testUserEditForm
Same name in other branches
- 9 core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php \Drupal\Tests\user\Kernel\UserAccountFormFieldsTest::testUserEditForm()
- 10 core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php \Drupal\Tests\user\Kernel\UserAccountFormFieldsTest::testUserEditForm()
- 11.x core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php \Drupal\Tests\user\Kernel\UserAccountFormFieldsTest::testUserEditForm()
Tests the user edit form.
File
-
core/
modules/ user/ tests/ src/ Kernel/ UserAccountFormFieldsTest.php, line 72
Class
- UserAccountFormFieldsTest
- Verifies that the field order in user account forms is compatible with password managers of web browsers.
Namespace
Drupal\Tests\user\KernelCode
public function testUserEditForm() {
// Install default configuration; required for AccountFormController.
$this->installConfig([
'user',
]);
// Install the router table and then rebuild.
\Drupal::service('router.builder')->rebuild();
$form = $this->buildAccountForm('default');
// Verify name and pass field order.
$this->assertFieldOrder($form['account']);
// Verify that autocomplete is off on all account fields.
foreach ([
'mail',
'name',
'pass',
] as $key) {
$this->assertIdentical($form['account'][$key]['#attributes']['autocomplete'], 'off', "'{$key}' field: 'autocomplete' attribute is 'off'.");
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.