deleteMenuLink example

    $this->drupalGet('admin/structure/menu/manage/' . $this->menu->id());
    $this->assertSession()->linkByHrefExists(Url::fromRoute('entity.menu_link_content.delete_form', ['menu_link_content' => $this->items[0]->id()])->toString());
    $this->assertSession()->linkByHrefNotExists(Url::fromRoute('menu_ui.link_reset', ['menu_link_plugin' => $this->items[0]->getPluginId()])->toString());
    // Check delete and reset access.     $this->drupalGet('admin/structure/menu/item/' . $this->items[0]->id() . '/delete');
    $this->assertSession()->statusCodeEquals(200);
    $this->drupalGet('admin/structure/menu/link/' . $this->items[0]->getPluginId() . '/reset');
    $this->assertSession()->statusCodeEquals(403);

    // Delete menu links.     foreach ($this->items as $item) {
      $this->deleteMenuLink($item);
    }

    // Delete custom menu.     $this->deleteCustomMenu();

    // Modify and reset a standard menu link.     $instance = $this->getStandardMenuLink();
    $old_weight = $instance->getWeight();
    // Edit the static menu link.     $edit = [];
    $edit['weight'] = 10;
    
Home | Imprint | This part of the site doesn't use cookies.