function MenuLinksTest::testMenuLinkContentFormInvalidParentMenu
Same name in other branches
- 10 core/modules/menu_link_content/tests/src/Kernel/MenuLinksTest.php \Drupal\Tests\menu_link_content\Kernel\MenuLinksTest::testMenuLinkContentFormInvalidParentMenu()
Tests that the form doesn't break for links with arbitrary menu names.
File
-
core/
modules/ menu_link_content/ tests/ src/ Kernel/ MenuLinksTest.php, line 467
Class
- MenuLinksTest
- Tests handling of menu links hierarchies.
Namespace
Drupal\Tests\menu_link_content\KernelCode
public function testMenuLinkContentFormInvalidParentMenu() : void {
$menu_link = MenuLinkContent::create([
'title' => 'Menu link test',
'provider' => 'menu_link_content',
'menu_name' => 'non-existent',
'link' => [
'uri' => 'internal:/user/login',
],
]);
// Get the form for a new link, assert that building it doesn't break if
// the links menu name doesn't exist.
$build = \Drupal::service('entity.form_builder')->getForm($menu_link);
static::assertIsArray($build);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.