Commit 7ce03d6b authored by catch's avatar catch

Issue #460408 by marthinal, gpk, girishmuraly, jojonaloha,...

Issue #460408 by marthinal, gpk, girishmuraly, jojonaloha, david_garcia_garcia, gnindl, nerdcore, acbramley, dotton, Cottser, dww: (regression tests for) Cannot administer menu item/link if it points to an unpublished node.
parent 3ea2e2cd
......@@ -434,6 +434,28 @@ function testSystemMenuRename() {
$this->assertText($edit['label']);
}
/**
* Tests that menu items pointing to unpublished nodes are editable.
*/
function testUnpublishedNodeMenuItem() {
$this->drupalLogin($this->drupalCreateUser(array('access administration pages', 'administer blocks', 'administer menu', 'create article content', 'bypass node access')));
// Create an unpublished node.
$node = $this->drupalCreateNode(array(
'type' => 'article',
'status' => NODE_NOT_PUBLISHED,
));
$item = $this->addMenuLink(0, 'node/' . $node->id());
$this->modifyMenuLink($item);
// Test that a user with 'administer menu' but without 'bypass node access'
// cannot see the menu item.
$this->drupalLogout();
$this->drupalLogin($this->admin_user);
$this->drupalGet('admin/structure/menu/manage/' . $item['menu_name']);
$this->assertNoText($item['link_title'], "Menu link pointing to unpublished node is only visible to users with 'bypass node access' permission");
}
/**
* Tests the contextual links on a menu block.
*/
......
Markdown is supported
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