Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
WCMS
uw_base_profile
Commits
5c472869
Commit
5c472869
authored
Apr 29, 2021
by
Liam Morland
Browse files
ISTWCMS-4705: Test layout_builder_lock
parent
26097106
Changes
1
Show whitespace changes
Inline
Side-by-side
tests/src/Functional/UwWcmsBasicTest.php
View file @
5c472869
...
...
@@ -432,6 +432,42 @@ class UwWcmsBasicTest extends BrowserTestBase {
// No access to delete page.
$this
->
drupalGet
(
'node/'
.
$content_nids
[
'uw_ct_web_page'
]
.
'/delete'
);
$this
->
assertSession
()
->
statusCodeEquals
(
403
);
// Test that admin has access to all Layout Builder configuration paths
// and site manager has access to only some paths.
$layout_builder_lock_test_users
=
[
'administrator'
,
'uw_role_site_manager'
,
];
$layout_builder_lock_test_content_types
=
[
'uw_ct_blog'
,
'uw_ct_event'
,
'uw_ct_news_item'
,
];
foreach
(
$layout_builder_lock_test_users
as
$user
)
{
$this
->
drupalLogin
(
$this
->
drupalUsers
[
$user
]);
foreach
(
$layout_builder_lock_test_content_types
as
$content_type
)
{
$nid
=
$content_nids
[
$content_type
];
$this
->
drupalGet
(
'node/'
.
$nid
.
'/layout'
);
$paths
=
[
'layout_builder/choose/section/overrides/node.'
.
$nid
.
'/0'
=>
FALSE
,
'layout_builder/choose/section/overrides/node.'
.
$nid
.
'/1'
=>
TRUE
,
'layout_builder/choose/section/overrides/node.'
.
$nid
.
'/2'
=>
TRUE
,
'layout_builder/choose/section/overrides/node.'
.
$nid
.
'/3'
=>
FALSE
,
'layout_builder/configure/section/overrides/node.'
.
$nid
.
'/0'
=>
FALSE
,
'layout_builder/configure/section/overrides/node.'
.
$nid
.
'/1'
=>
TRUE
,
'layout_builder/configure/section/overrides/node.'
.
$nid
.
'/2'
=>
FALSE
,
];
foreach
(
$paths
as
$path
=>
$access
)
{
if
(
$access
||
$user
===
'administrator'
)
{
$this
->
assertSession
()
->
linkByHrefExists
(
$path
);
}
else
{
$this
->
assertSession
()
->
linkByHrefNotExists
(
$path
);
}
}
}
}
}
/**
...
...
Liam Morland
@lkmorlan
mentioned in commit
c6afdfb2
·
Jun 17, 2021
mentioned in commit
c6afdfb2
mentioned in commit c6afdfb2309264b89e30bda20c4db6e172472ef7
Toggle commit list
Liam Morland
@lkmorlan
mentioned in merge request
!162 (merged)
·
Jun 17, 2021
mentioned in merge request
!162 (merged)
mentioned in merge request !162
Toggle commit list
Liam Morland
@lkmorlan
mentioned in commit
198c49fa
·
Jun 17, 2021
mentioned in commit
198c49fa
mentioned in commit 198c49faa6ebfb25dc86f0bb2b4d7855dbc2234f
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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