| 7 menu.test | MenuRouterTestCase::testMenuLinkOptions() |
| 8 menu.test | MenuRouterTestCase::testMenuLinkOptions() |
Test menu link 'options' storage and rendering.
File
- modules/
simpletest/ tests/ menu.test, line 556 - Provides SimpleTests for menu.inc.
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(
'testparam' => 'testvalue',
),
),
);
menu_link_save($menu_link);
// Load front page.
$this->drupalGet('node');
$this->assertRaw('title="Test title attribute"', t('Title attribute of a menu link renders.'));
$this->assertRaw('testparam=testvalue', t('Query parameter added to menu link.'));
}
Login or register to post comments