public function MenuLinkContentFormTest::testMenuLinkContentForm in Drupal 8
Same name and namespace in other branches
- 9 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentFormTest::testMenuLinkContentForm()
Tests the MenuLinkContentForm class.
File
- core/
modules/ menu_link_content/ tests/ src/ Functional/ MenuLinkContentFormTest.php, line 84
Class
- MenuLinkContentFormTest
- Tests the menu link content UI.
Namespace
Drupal\Tests\menu_link_content\FunctionalCode
public function testMenuLinkContentForm() {
$this
->drupalGet('admin/structure/menu/manage/admin/add');
$element = $this
->xpath('//select[@id = :id]/option[@selected]', [
':id' => 'edit-menu-parent',
]);
$this
->assertNotEmpty($element, 'A default menu parent was found.');
$this
->assertEqual('admin:', $element[0]
->getValue(), '<Administration> menu is the parent.');
// Test that the field description is present.
$this
->assertRaw('The location this menu link points to.');
$this
->drupalPostForm(NULL, [
'title[0][value]' => t('Front page'),
'link[0][uri]' => '<front>',
], t('Save'));
$this
->assertText(t('The menu link has been saved.'));
}