function MenuUiTest::doMenuLinkFormDefaultsTest

Same name in other branches
  1. 8.9.x core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::doMenuLinkFormDefaultsTest()
  2. 10 core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::doMenuLinkFormDefaultsTest()
  3. 11.x core/modules/menu_ui/tests/src/Functional/MenuUiTest.php \Drupal\Tests\menu_ui\Functional\MenuUiTest::doMenuLinkFormDefaultsTest()

Ensures that the proper default values are set when adding a menu link.

1 call to MenuUiTest::doMenuLinkFormDefaultsTest()
MenuUiTest::doMenuTests in core/modules/menu_ui/tests/src/Functional/MenuUiTest.php
Tests menu functionality.

File

core/modules/menu_ui/tests/src/Functional/MenuUiTest.php, line 581

Class

MenuUiTest
Tests the menu UI.

Namespace

Drupal\Tests\menu_ui\Functional

Code

protected function doMenuLinkFormDefaultsTest() {
    $this->drupalGet("admin/structure/menu/manage/tools/add");
    $this->assertSession()
        ->statusCodeEquals(200);
    $this->assertSession()
        ->fieldValueEquals('title[0][value]', '');
    $this->assertSession()
        ->fieldValueEquals('link[0][uri]', '');
    $this->assertSession()
        ->checkboxNotChecked('edit-expanded-value');
    $this->assertSession()
        ->checkboxChecked('edit-enabled-value');
    $this->assertSession()
        ->fieldValueEquals('description[0][value]', '');
    $this->assertSession()
        ->fieldValueEquals('weight[0][value]', 0);
}

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