Attempt to add menu link with invalid path or no access permission.
string $menu_name Menu name.:
function addInvalidMenuLink($menu_name = 'tools') {
foreach (array(
'-&-',
'admin/people/permissions',
'#',
) as $link_path) {
$edit = array(
'link_path' => $link_path,
'link_title' => 'title',
);
$this
->drupalPost("admin/structure/menu/manage/{$menu_name}/add", $edit, t('Save'));
$this
->assertRaw(t("The path '@path' is either invalid or you do not have access to it.", array(
'@path' => $link_path,
)), 'Menu link was not created');
}
}