function MenuLinkContentDeprecationsTest::testMenuLinkContentFormConstructorDeprecation

Same name and namespace in other branches
  1. 10 core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeprecationsTest.php \Drupal\Tests\menu_link_content\Kernel\MenuLinkContentDeprecationsTest::testMenuLinkContentFormConstructorDeprecation()

Tests the deprecation in the \Drupal\menu_link_content\Form\MenuLinkContentForm constructor.

File

core/modules/menu_link_content/tests/src/Kernel/MenuLinkContentDeprecationsTest.php, line 25

Class

MenuLinkContentDeprecationsTest
Tests the deprecation notices of the menu_link_content module.

Namespace

Drupal\Tests\menu_link_content\Kernel

Code

public function testMenuLinkContentFormConstructorDeprecation() : void {
    $entity_repository = $this->prophesize(EntityRepositoryInterface::class);
    $menu_parent_form_selector = $this->prophesize(MenuParentFormSelectorInterface::class);
    $language_manager = $this->prophesize(LanguageManagerInterface::class);
    $path_validator = $this->prophesize(PathValidatorInterface::class);
    $entity_type_bundle_info = $this->prophesize(EntityTypeBundleInfoInterface::class);
    $time = $this->prophesize(TimeInterface::class);
    $this->expectDeprecation('Calling Drupal\\menu_link_content\\Form\\MenuLinkContentForm::__construct() with the $language_manager argument is deprecated in drupal:10.2.0 and is removed in drupal:11.0.0. See https://www.drupal.org/node/3325178');
    new MenuLinkContentForm($entity_repository->reveal(), $menu_parent_form_selector->reveal(), $language_manager->reveal(), $path_validator->reveal(), $entity_type_bundle_info->reveal(), $time->reveal());
}

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