Skip to content
Snippets Groups Projects
Commit 2dd3e496 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1621548 by tedstein, droplet, mjonesdinero, bendev, disasm: Fixed User...

Issue #1621548 by tedstein, droplet, mjonesdinero, bendev, disasm: Fixed User status should not default to blocked.
parent e06e8961
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -30,9 +30,18 @@ protected function testUserAdd() { ...@@ -30,9 +30,18 @@ protected function testUserAdd() {
$user = $this->drupalCreateUser(array('administer users')); $user = $this->drupalCreateUser(array('administer users'));
$this->drupalLogin($user); $this->drupalLogin($user);
// Test user creation page for valid fields.
$this->drupalGet('admin/people/create');
$this->assertFieldbyId('edit-status-0', 0, 'The user status option Blocked exists.', 'User login');
$this->assertFieldbyId('edit-status-1', 1, 'The user status option Active exists.', 'User login');
$this->assertFieldByXPath('//input[@type="radio" and @id="edit-status-1" and @checked="checked"]', NULL, 'Default setting for user status is active.');
// We create two users, notifying one and not notifying the other, to
// ensure that the tests work in both cases.
foreach (array(FALSE, TRUE) as $notify) { foreach (array(FALSE, TRUE) as $notify) {
$name = $this->randomName();
$edit = array( $edit = array(
'name' => $this->randomName(), 'name' => $name,
'mail' => $this->randomName() . '@example.com', 'mail' => $this->randomName() . '@example.com',
'pass[pass1]' => $pass = $this->randomString(), 'pass[pass1]' => $pass = $this->randomString(),
'pass[pass2]' => $pass, 'pass[pass2]' => $pass,
...@@ -51,6 +60,8 @@ protected function testUserAdd() { ...@@ -51,6 +60,8 @@ protected function testUserAdd() {
$this->drupalGet('admin/people'); $this->drupalGet('admin/people');
$this->assertText($edit['name'], 'User found in list of users'); $this->assertText($edit['name'], 'User found in list of users');
$user = user_load_by_name($name);
$this->assertEqual($user->status == 1, 'User is not blocked');
} }
} }
} }
...@@ -91,7 +91,7 @@ class User extends Entity { ...@@ -91,7 +91,7 @@ class User extends Entity {
* *
* @var integer * @var integer
*/ */
public $status = 0; public $status = 1;
/** /**
* The user's timezone. * The user's timezone.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment