diff --git a/src/Tests/PathautoUiTest.php b/src/Tests/PathautoUiTest.php index c1bd0f4..6e0bac5 100644 --- a/src/Tests/PathautoUiTest.php +++ b/src/Tests/PathautoUiTest.php @@ -209,26 +209,29 @@ class PathautoUiTest extends WebTestBase { $this->drupalCreateNode(['type' => 'page', 'title' => 'Llama']); $this->drupalCreateNode(['type' => 'page', 'title' => 'Vicuña']); - // Enable a menu link for the nodes. + // Enable a menu link for both nodes. $edit = ['menu[enabled]' => 1]; $this->drupalGet('node/1/edit'); $this->drupalPostForm(NULL, $edit + ['menu[title]' => 'Llama'], 'Save and keep published'); $this->drupalGet('node/2/edit'); $this->drupalPostForm(NULL, $edit + ['menu[title]' => 'Vicuña'], 'Save and keep published'); - // Test that both nodes have an alias and that it returns HTTP/200. + // Test that both nodes have an alias and that it returns a HTTP/200 + // response. $this->drupalGet('llama'); $this->assertResponse(200); $this->drupalGet('vicuna'); $this->assertResponse(200); - // Change the parent menu item to Llama. + // Change the parent menu item of Vicuna to Llama. $this->drupalGet('node/2/edit'); + // Use xpath to get the value, because the value includes a UUID, and we + // can't hardcode that. $llama_option_xml = $this->xpath('//select[@id="edit-menu-menu-parent"]/option[text() = "-- Llama"]/@value'); $llama_option = (string) $llama_option_xml[0]->{"value"}; $this->drupalPostForm(NULL, ['menu[menu_parent]' => $llama_option], 'Save and keep published'); - // Check that vicuna is now under llama. + // Check that vicuna is now under llama and it returns a HTTP/200 response. $this->drupalGet('llama/vicuna'); $this->assertResponse(200); @@ -236,8 +239,8 @@ class PathautoUiTest extends WebTestBase { $this->drupalGet('node/2/edit'); $this->drupalPostForm(NULL, ['menu[menu_parent]' => 'main:'], 'Save and keep published'); - // Check that vicuna is now under the root again and that the old url now - // throws a 404. + // Check that vicuna is now under the root again and it returns a HTTP/200 + // response. The old url should now return a HTTP/404 response. $this->drupalGet('llama/vicuna'); $this->assertResponse(404); $this->drupalGet('vicuna');