updateLink example

    $this->treeStorage->save($definition);
    return $this->createInstance($id);
  }

  /** * {@inheritdoc} */
  public function updateDefinition($id, array $new_definition_values$persist = TRUE) {
    $instance = $this->createInstance($id);
    if ($instance) {
      $new_definition_values['id'] = $id;
      $changed_definition = $instance->updateLink($new_definition_values$persist);
      $this->treeStorage->save($changed_definition);
    }
    return $instance;
  }

  /** * {@inheritdoc} */
  public function resetLink($id) {
    $instance = $this->createInstance($id);
    $new_instance = $this->resetInstance($instance);
    
'weight' => 10,
    ];
    $expected_plugin_definition = $plugin_definition;
    $expected_plugin_definition['weight'] = -10;

    $static_override = $this->prophesize(StaticMenuLinkOverridesInterface::class);
    $static_override->saveOverride('example_menu_link', $expected_plugin_definition);
    $static_override = $static_override->reveal();

    $menu_link = new MenuLinkDefault([], 'example_menu_link', $plugin_definition$static_override);

    $this->assertEquals($expected_plugin_definition$menu_link->updateLink(['weight' => -10], TRUE));
  }

  /** * @covers ::updateLink */
  public function testUpdateLinkWithoutPersist() {
    $plugin_definition = [
      'title' => 'Hey jude',
      'enabled' => 1,
      'expanded' => 1,
      'menu_name' => 'admin',
      
Home | Imprint | This part of the site doesn't use cookies.