function UserEditTest::testUserWithoutEmailEdit
Same name in other branches
- 9 core/modules/user/tests/src/Functional/UserEditTest.php \Drupal\Tests\user\Functional\UserEditTest::testUserWithoutEmailEdit()
- 8.9.x core/modules/user/tests/src/Functional/UserEditTest.php \Drupal\Tests\user\Functional\UserEditTest::testUserWithoutEmailEdit()
- 11.x core/modules/user/tests/src/Functional/UserEditTest.php \Drupal\Tests\user\Functional\UserEditTest::testUserWithoutEmailEdit()
Tests editing of a user account without an email address.
File
-
core/
modules/ user/ tests/ src/ Functional/ UserEditTest.php, line 165
Class
- UserEditTest
- Tests user edit page.
Namespace
Drupal\Tests\user\FunctionalCode
public function testUserWithoutEmailEdit() : void {
// Test that an admin can edit users without an email address.
$admin = $this->drupalCreateUser([
'administer users',
]);
$this->drupalLogin($admin);
// Create a regular user.
$user1 = $this->drupalCreateUser([]);
// This user has no email address.
$user1->mail = '';
$user1->save();
$this->drupalGet("user/" . $user1->id() . "/edit");
$this->submitForm([
'mail' => '',
], 'Save');
$this->assertSession()
->pageTextContains("The changes have been saved.");
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.