From 802e1a0a49dba419f077fbb213efec6052600d1f Mon Sep 17 00:00:00 2001 From: shalini_jha <shalini.jha@qed42.com> Date: Wed, 20 Nov 2024 12:41:47 +0530 Subject: [PATCH] Issue #3486797: Added test coverage for workspace alias behaviour with language updates --- .../tests/src/Functional/PathWorkspacesTest.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php index c6ad707fb78e..56eaa5fbd504 100644 --- a/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php +++ b/core/modules/workspaces/tests/src/Functional/PathWorkspacesTest.php @@ -198,6 +198,9 @@ public function testPathAliasesWithTranslation(): void { $this->assertAccessiblePaths([$default_path, $translation_path]); + // Verify the default alias is available in the live workspace. + $this->assertAccessiblePaths([$default_path]); + $this->switchToWorkspace($stage); $this->assertAccessiblePaths([$default_path, $translation_path]); @@ -311,6 +314,20 @@ public function testPathAliasesWithTranslation(): void { $stage->publish(); $this->assertAccessiblePaths([$default_path, $new_stage_translation_path]); $this->assertNotAccessiblePaths([$stage_translation_path]); + + // Switch back to Stage. + $this->switchToWorkspace($stage); + + // Edit the path alias to set its language to "Not specified". + $alias_edit_path = "admin/config/search/path/edit/{$default_node->id()}"; + $this->drupalGet($alias_edit_path); + $edit = [ + 'langcode[0][value]' => 'und', // Set the alias language to "Not specified". + ]; + $this->submitForm($edit, 'Save'); + + // Verify the path alias is still available in the Stage workspace. + $this->assertAccessiblePaths([$default_path]); } /** -- GitLab