Commit 241f1558 authored by Lily Yan's avatar Lily Yan
Browse files

ISTWCMS-4530 Test User protect rule for authenticated user

parent 9092cc86
......@@ -907,6 +907,32 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertSession()->checkboxNotChecked('edit-uw-role-content-author-assign-roles');
$this->assertSession()->checkboxNotChecked('edit-uw-role-form-editor-assign-roles');
$this->assertSession()->checkboxNotChecked('edit-uw-role-form-results-access-assign-roles');
// Check Edit protection rule Authenticated user page.
$this->drupalGet('admin/config/people/userprotect/manage/uw_protect_authenticated_user');
$this->assertSession()->statusCodeEquals(200);
// Get Name field value: Authenticated user.
$this->getSession()->getPage()->findField('edit-label')->getValue('Authenticated user');
// Get Role field value: Authenticated user.
$this->getSession()->getPage()->findById('edit-entity-id')->getValue('Authenticated user');
// Only status and cancel operation are checked in proection field.
$this->assertSession()->checkboxChecked('edit-protection-user-status');
$this->assertSession()->checkboxChecked('edit-protection-user-delete');
$this->assertSession()->checkboxNotChecked('edit-protection-user-name');
$this->assertSession()->checkboxNotChecked('edit-protection-user-mail');
$this->assertSession()->checkboxNotChecked('edit-protection-user-pass');
$this->assertSession()->checkboxNotChecked('edit-protection-user-roles');
$this->assertSession()->checkboxNotChecked('edit-protection-user-edit');
// Only Administrator is checked in Bypass for roles.
$this->assertSession()->checkboxChecked('edit-bypass-roles-administrator');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-anonymous');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-authenticated');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-site-owner');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-site-manager');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-content-editor');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-content-author');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-form-editor');
$this->assertSession()->checkboxNotChecked('edit-bypass-roles-uw-role-form-results-access');
// The other users do not have access permissions and roleassign pages.
$roles = [
'authenticated user',
......@@ -922,6 +948,8 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this->assertSession()->statusCodeEquals(403);
$this->drupalGet('admin/people/roleassign');
$this->assertSession()->statusCodeEquals(403);
$this->drupalGet('admin/config/people/userprotect/manage/uw_protect_authenticated_user');
$this->assertSession()->statusCodeEquals(403);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment