summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebchick2012-07-07 20:42:34 (GMT)
committerwebchick2012-07-07 20:42:34 (GMT)
commit2dd3e49638ef61ea6743571cd98abff4ca6e3613 (patch)
treec410c82c8688ed3c8720436ab374b9d25a97c652
parente06e89612ead5e5deeba36872e3ef5e6293ec827 (diff)
Issue #1621548 by tedstein, droplet, mjonesdinero, bendev, disasm: Fixed User status should not default to blocked.
-rw-r--r--core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php13
-rw-r--r--core/modules/user/lib/Drupal/user/User.php2
2 files changed, 13 insertions, 2 deletions
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
index cfa7254..f728123 100644
--- a/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
+++ b/core/modules/user/lib/Drupal/user/Tests/UserCreateTest.php
@@ -30,9 +30,18 @@ class UserCreateTest extends WebTestBase {
$user = $this->drupalCreateUser(array('administer users'));
$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) {
+ $name = $this->randomName();
$edit = array(
- 'name' => $this->randomName(),
+ 'name' => $name,
'mail' => $this->randomName() . '@example.com',
'pass[pass1]' => $pass = $this->randomString(),
'pass[pass2]' => $pass,
@@ -51,6 +60,8 @@ class UserCreateTest extends WebTestBase {
$this->drupalGet('admin/people');
$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');
}
}
}
diff --git a/core/modules/user/lib/Drupal/user/User.php b/core/modules/user/lib/Drupal/user/User.php
index 992923c..382d3d7 100644
--- a/core/modules/user/lib/Drupal/user/User.php
+++ b/core/modules/user/lib/Drupal/user/User.php
@@ -91,7 +91,7 @@ class User extends Entity {
*
* @var integer
*/
- public $status = 0;
+ public $status = 1;
/**
* The user's timezone.