Commit 0596e74b authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/ISTWCMS-4704-lkmorlan-remove-layout_builder_lock-test' into '3.0.x'

ISTWCMS-4704: Remove testing of layout_builder_lock

See merge request !162
parents ec0a6462 198c49fa
......@@ -585,60 +585,6 @@ 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);
}
}
}
// Test Layout Builder configuration paths for catalog item content type.
// catalog item content type only has one configure section and the above
// content types have three configure sections (1, 2, 3).
$nid = $content_nids['uw_ct_catalog_item'];
$this->drupalGet('node/' . $nid . '/layout');
$paths = [
'layout_builder/choose/section/overrides/node.' . $nid . '/0' => TRUE,
'layout_builder/choose/section/overrides/node.' . $nid . '/1' => FALSE,
'layout_builder/configure/section/overrides/node.' . $nid . '/0' => FALSE,
];
foreach ($paths as $path => $access) {
if ($access || $user === 'administrator') {
$this->assertSession()->linkByHrefExists($path);
}
else {
$this->assertSession()->linkByHrefNotExists($path);
}
}
}
}
/**
......
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