You are here

protected function UserProtectProtectionWebTest::testStatusProtection in User protect 7

Tests if the user's status field has the expected protection.

File

tests/UserProtectProtectionWebTest.test, line 121
Contains UserProtectProtectionWebTest.

Class

UserProtectProtectionWebTest
Tests creating, editing and deleting protection rules through the UI.

Code

protected function testStatusProtection() {
  $protected_account = $this
    ->createProtectedUser(array(
    'up_status' => 1,
  ));

  // Try to deactivate user's status.
  $edit = array(
    'status' => '0',
  );
  $this
    ->userprotectPostForm('user/' . $protected_account->uid . '/edit', $edit, t('Save'));

  // Re-load the user and check the user is still active.
  $protected_account = user_load($protected_account->uid, TRUE);
  $this
    ->assertTrue($protected_account->status);
}