function MenuLinkAddTest::testDeprecation

Tests \Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd deprecation.

File

core/modules/menu_ui/tests/src/Kernel/MenuLinkAddTest.php, line 33

Class

MenuLinkAddTest
Tests \Drupal\menu_ui\Plugin\Menu\LocalAction\MenuLinkAdd deprecation.

Namespace

Drupal\Tests\menu_ui\Kernel

Code

public function testDeprecation() : void {
    
    /** @var \Drupal\Core\Menu\LocalActionManagerInterface $local_action_manager */
    $local_action_manager = $this->container
        ->get('plugin.manager.menu.local_action');
    $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');
    $instance = $local_action_manager->createInstance('entity.menu.add_link_form_deprecated');
    $this->assertInstanceOf(MenuLinkAdd::class, $instance);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.