You are here

function MenuModuleInvalidPath::testMenuModuleInvalidPath in SimpleTest 6

File

tests/menu_module.test, line 262

Class

MenuModuleInvalidPath

Code

function testMenuModuleInvalidPath() {
  $web_user = $this
    ->drupalCreateUserRolePerm(array(
    'administer menu',
  ));
  $this
    ->drupalLoginUser($web_user);
  foreach (array(
    '-&-',
    'admin/user/permissions',
  ) as $invalid_path) {
    $edit = array(
      'menu[link_path]' => $invalid_path,
      'menu[link_title]' => 'title',
    );
    $this
      ->drupalPost("admin/build/menu-customize/navigation/add", $edit, "Save");
    $this
      ->assertWantedRaw(t("The path '@path' is either invalid or you do not have access to it.", array(
      '@path' => $invalid_path,
    )), 'Invalid path failed');
  }
}