You are here

function MenuAttributesTestCase::testMenuAttributes in Menu Attributes 7

Tests menu attributes functionality.

File

./menu_attributes.test, line 137
Functionality tests for Menu attributes.

Class

MenuAttributesTestCase
Test basic functionality.

Code

function testMenuAttributes() {

  // Login the user.
  $this
    ->drupalLogin($this->admin_user);
  $menu_name = 'navigation';

  // Add a node to be used as a link for menu links.
  $node = $this
    ->drupalCreateNode(array(
    'type' => 'page',
  ));

  // Add a menu link.
  $item = $this
    ->crudMenuLink(0, 0, 'node/' . $node->nid, $menu_name);
  $this
    ->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
  $this
    ->assertMenuAttributes('options[attributes]', 'new');

  // Edit the previously created menu link.
  $item = $this
    ->crudMenuLink($item['mlid'], 0, 'node/' . $node->nid, $menu_name);
  $this
    ->drupalGet('admin/structure/menu/item/' . $item['mlid'] . '/edit');
  $this
    ->assertMenuAttributes('options[attributes]', 'edit');
}