protected function UserProtectProtectionWebTest::testNameProtection in User protect 7
Tests if the user's name field has the expected protection.
File
- tests/
UserProtectProtectionWebTest.test, line 60 - Contains UserProtectProtectionWebTest.
Class
- UserProtectProtectionWebTest
- Tests creating, editing and deleting protection rules through the UI.
Code
protected function testNameProtection() {
$protected_account = $this
->createProtectedUser(array(
'up_name' => 1,
));
// Remember the user's name.
$expected_name = $protected_account->name;
$edit = array(
'name' => $this
->randomName(),
);
$this
->userprotectPostForm('user/' . $protected_account->uid . '/edit', $edit, t('Save'));
// Re-load the user and check the user name didn't change.
$protected_account = user_load($protected_account->uid, TRUE);
$this
->assertEqual($expected_name, $protected_account->name);
}