From 3e9d2ab68e7614607448fb55abced8674aec4332 Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 30 Mar 2021 14:14:02 -0400 Subject: [PATCH 1/3] ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set --- tests/src/Functional/UwWcmsBasicTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/tests/src/Functional/UwWcmsBasicTest.php b/tests/src/Functional/UwWcmsBasicTest.php index 09ae92fd..49c633df 100644 --- a/tests/src/Functional/UwWcmsBasicTest.php +++ b/tests/src/Functional/UwWcmsBasicTest.php @@ -344,15 +344,26 @@ class UwWcmsBasicTest extends BrowserTestBase { // Get alias from the above $url. e.g. https://d8/fdsu1/home/edit. $url = substr($url, 0, -5); +<<<<<<< HEAD $url = explode('/', $url); +======= + $url = explode("/", $url); +>>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $alias = end($url); // Get path (node/nid) from the alias. $path = \Drupal::service('path_alias.manager')->getPathByAlias('/' . $alias); +<<<<<<< HEAD $nid = explode('/', $path, 3); // Get nid. Save for later use. $web_page_nid = (int) end($nid); +======= + $nid = explode("/", $path); + + // Get nid. Save for later use. + $web_page_nid = end($nid); +>>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $this->assert($web_page_nid > 0, 'Positive nid found.'); } } @@ -366,7 +377,11 @@ class UwWcmsBasicTest extends BrowserTestBase { ]; $this->drupalPostForm('node/add/uw_ct_sidebar', $edit, 'Save'); // Verify that the user is redirected to the layout edit page. +<<<<<<< HEAD $this->assertSession()->addressMatches('/^\/[a-z0-9-\/]+\/layout$/'); +======= + $this->assertSession()->addressMatches(',^/[a-z0-9-\/]+\/layout,'); +>>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $this->assertSession()->pageTextContains('You are editing the layout for this Sidebar content item.'); // On home page, most users do not have content moderation link. -- GitLab From 9d1e3015b432992ac06bdec0c27701e58619c6ad Mon Sep 17 00:00:00 2001 From: Lily Yan Date: Tue, 16 Mar 2021 13:27:08 -0400 Subject: [PATCH 2/3] ISTWCMS-4688 Test to make sure catalog listing page to the main menu but disabled --- tests/src/Functional/UwWcmsBasicTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/src/Functional/UwWcmsBasicTest.php b/tests/src/Functional/UwWcmsBasicTest.php index 49c633df..05f578f4 100644 --- a/tests/src/Functional/UwWcmsBasicTest.php +++ b/tests/src/Functional/UwWcmsBasicTest.php @@ -1180,6 +1180,12 @@ class UwWcmsBasicTest extends BrowserTestBase { $this->assertSession()->statusCodeEquals(200); $this->assertSession()->elementExists('css', 'select#edit-menu-parent'); $this->assertSession()->elementNotExists('css', 'select#edit-menu-parent > option[value="main:uw_base_profile.front_page"]'); + + // Test that main menu has disabled Catalogs menu link. + $this->drupalGet('admin/structure/menu/manage/main'); + $this->assertSession()->statusCodeEquals(200); + $this->assertEquals(base_path() . 'catalogs', $this->getSession()->getPage()->findLink('Catalogs')->getAttribute('href')); + $this->assertSession()->checkboxNotChecked('edit-links-menu-plugin-iduw-main-menucatalogs-enabled'); } /** -- GitLab From aa8dae6132bdff2b7429cc8dcf2d01e5e8e41c4e Mon Sep 17 00:00:00 2001 From: kpaxman Date: Fri, 16 Apr 2021 11:23:07 -0400 Subject: [PATCH 3/3] FDSU-4688: fix missed merge conflicts --- tests/src/Functional/UwWcmsBasicTest.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/tests/src/Functional/UwWcmsBasicTest.php b/tests/src/Functional/UwWcmsBasicTest.php index 05f578f4..30da6cec 100644 --- a/tests/src/Functional/UwWcmsBasicTest.php +++ b/tests/src/Functional/UwWcmsBasicTest.php @@ -344,26 +344,15 @@ class UwWcmsBasicTest extends BrowserTestBase { // Get alias from the above $url. e.g. https://d8/fdsu1/home/edit. $url = substr($url, 0, -5); -<<<<<<< HEAD $url = explode('/', $url); -======= - $url = explode("/", $url); ->>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $alias = end($url); // Get path (node/nid) from the alias. $path = \Drupal::service('path_alias.manager')->getPathByAlias('/' . $alias); -<<<<<<< HEAD $nid = explode('/', $path, 3); // Get nid. Save for later use. $web_page_nid = (int) end($nid); -======= - $nid = explode("/", $path); - - // Get nid. Save for later use. - $web_page_nid = end($nid); ->>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $this->assert($web_page_nid > 0, 'Positive nid found.'); } } @@ -377,11 +366,7 @@ class UwWcmsBasicTest extends BrowserTestBase { ]; $this->drupalPostForm('node/add/uw_ct_sidebar', $edit, 'Save'); // Verify that the user is redirected to the layout edit page. -<<<<<<< HEAD $this->assertSession()->addressMatches('/^\/[a-z0-9-\/]+\/layout$/'); -======= - $this->assertSession()->addressMatches(',^/[a-z0-9-\/]+\/layout,'); ->>>>>>> 1c4cd90 (ISTWCMS-4222 Refactor createContent() due to subpathauto is enabled and set) $this->assertSession()->pageTextContains('You are editing the layout for this Sidebar content item.'); // On home page, most users do not have content moderation link. -- GitLab