Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WCMS
uw_base_profile
Commits
de9fe937
Commit
de9fe937
authored
Jan 14, 2021
by
Lily Yan
Browse files
ISTWCMS-4530 Test user protect
parent
241f1558
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/src/Functional/UwWcmsBasicTest.php
View file @
de9fe937
...
...
@@ -951,6 +951,40 @@ class UwWcmsBasicTest extends BrowserTestBase {
$this
->
drupalGet
(
'admin/config/people/userprotect/manage/uw_protect_authenticated_user'
);
$this
->
assertSession
()
->
statusCodeEquals
(
403
);
}
// Administrator still has access to "status" and "cancel account"
// options for users with all roles..
$this
->
drupalLogin
(
$this
->
drupalUsers
[
'administrator'
]);
$this
->
drupalGet
(
'admin/people'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
getSession
()
->
getPage
()
->
clickLink
(
'uw_role_site_owner'
);
$this
->
getSession
()
->
getPage
()
->
clickLink
(
'Edit'
);
$this
->
assertSession
()
->
pageTextContains
(
'Status'
);
$this
->
assertSession
()
->
buttonExists
(
'edit-delete'
);
$this
->
drupalLogout
();
// Site owner oes not have access to "status" and "cancel account"
// for other users.
$this
->
drupalLogin
(
$this
->
drupalUsers
[
'uw_role_site_owner'
]);
$this
->
drupalGet
(
'admin/people'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
getSession
()
->
getPage
()
->
clickLink
(
'uw_role_site_manager'
);
$this
->
getSession
()
->
getPage
()
->
clickLink
(
'Edit'
);
$this
->
assertSession
()
->
pageTextContains
(
'has been protected from the following editing operations: Status'
);
$this
->
assertSession
()
->
buttonNotExists
(
'edit-delete'
);
$this
->
drupalLogout
();
// All other roles (e.g. site manager) do not have access
// to other accounts (e.g. content author).
$this
->
drupalLogin
(
$this
->
drupalUsers
[
'uw_role_site_manager'
]);
$this
->
drupalGet
(
'users/uwrolecontentauthor'
);
$this
->
assertSession
()
->
statusCodeEquals
(
403
);
// The users are able to change their own account (email and password).
$this
->
drupalGet
(
'users/uwrolesitemanager'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
$this
->
clickLink
(
'Edit profile'
);
$this
->
assertSession
()
->
statusCodeEquals
(
200
);
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment