1 menu.test MenuTestCase::deleteCustomMenu($menu)

Delete custom menu.

Parameters

string $menu_name Custom menu name.:

File

core/modules/menu/tests/menu.test, line 201
Tests for menu.module.

Class

MenuTestCase

Code

function deleteCustomMenu($menu) {
  $menu_name = $this->menu['menu_name'];
  $title = $this->menu['title'];

  // Delete custom menu.
  $this->backdropPost("admin/structure/menu/manage/$menu_name/delete", array(), t('Delete'));
  $this->assertResponse(200);
  $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), 'Custom menu was deleted');
  $this->assertFalse(menu_load($menu_name), 'Custom menu was deleted');
  // Test if all menu links associated to the menu were removed from database.
  $result = db_query("SELECT menu_name FROM {menu_links} WHERE menu_name = :menu_name", array(':menu_name' => $menu_name))->fetchField();
  $this->assertFalse($result, 'All menu links associated to the custom menu were deleted.');
}