1 menu.test MenuRouterTestCase::testMenuLinkOptions()

Test menu link 'options' storage and rendering.

File

core/modules/simpletest/tests/menu.test, line 482
Provides SimpleTests for menu.inc.

Class

MenuRouterTestCase

Code

function testMenuLinkOptions() {
  // Create a menu link with options.
  $menu_link = array(
    'link_title' => 'Menu link options test',
    'link_path' => 'node',
    'module' => 'menu_test',
    'options' => array(
      'attributes' => array(
        'title' => 'Test title attribute',
      ),
      'query' => array(
        'test_param' => 'test_value',
      ),
    ),
  );
  menu_link_save($menu_link);

  // Load home page.
  $this->backdropGet('<front>');
  $this->assertRaw('title="Test title attribute"', 'Title attribute of a menu link renders.');
  $this->assertRaw('test_param=test_value', 'Query parameter added to menu link.');
}