Resolve #2762131 "Generalize menulinkadd"
Closes #2762131
Merge request reports
Activity
added 2 commits
added 1 commit
- af473af2 - Avoid error in LocalActionWithDestination::getOptions()
- Resolved by Tobias Zimmermann
added 1 commit
- a1ae77ed - Drop constructor docs and use property promotion in LocalActionWithDestination
- Resolved by Alex Pott
- Resolved by Tobias Zimmermann
- Resolved by Tobias Zimmermann
added 2 commits
- Resolved by Alex Pott
28 ]; 29 30 /** 31 * Tests \Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd deprecation. 32 */ 33 public function testDeprecation(): void { 34 /** @var \Drupal\Core\Menu\LocalActionManagerInterface $local_action_manager */ 35 $local_action_manager = $this->container->get('plugin.manager.menu.local_action'); 36 37 $this->expectDeprecation('Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd is deprecated in drupal:11.2.0 and is removed from drupal:12.0.0. Use \Drupal\Core\Menu\LocalActionWithDestination instead. See https://www.drupal.org/node/3490245'); 38 $instance = $local_action_manager->createInstance('entity.menu.add_link_form_deprecated'); 39 $this->assertInstanceOf(MenuLinkAdd::class, $instance); 40 } 41 42 /** 43 * Tests deprecated plugin does not trigger deprecation unless used. For me the problem with this bit: '..unless used.' is I naturally ask myself 'unless WHAT is used?' ie 'unless the dp is used?' or 'unless the trigger deprecation is used.' That makes it fiendishly hard to understand. Obviously if you have coded lots of such things no problem at all! Code comments are hopefully comprehensible to both categories of user? This does not make it easy for an outsider to understand but it gives them a chance.
Edited by andrew farquharson@kristiaanvandeneynde in this instance we are testing exactly the opposite of that. I.e. that the existence of a deprecated plugin does not trigger a deprecation unless it is actually instantiated.
Better: 'Tests that only an instantiated deprecated plugin can trigger a deprecation.' 76 chars
Edited by andrew farquharson