You are here

public function MenuLinkContentFormTest::testMenuLinkContentFormValidation in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentFormTest::testMenuLinkContentFormValidation()
  2. 10 core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php \Drupal\Tests\menu_link_content\Functional\MenuLinkContentFormTest::testMenuLinkContentFormValidation()

Tests validation for the MenuLinkContentForm class.

File

core/modules/menu_link_content/tests/src/Functional/MenuLinkContentFormTest.php, line 106

Class

MenuLinkContentFormTest
Tests the menu link content UI.

Namespace

Drupal\Tests\menu_link_content\Functional

Code

public function testMenuLinkContentFormValidation() {
  $this
    ->drupalGet('admin/structure/menu/manage/admin/add');
  $this
    ->drupalPostForm(NULL, [
    'title[0][value]' => t('Test page'),
    'link[0][uri]' => '<test>',
  ], t('Save'));
  $this
    ->assertText(t('Manually entered paths should start with one of the following characters: / ? #'));
}