You are here

public function MenuNodeAPITestCase::menuNodeAPICreateItems in Menu Node API 7

Helper function to create menu items which are not nodes.

Parameters

$count: The number of items to create.

1 call to MenuNodeAPITestCase::menuNodeAPICreateItems()
MenuNodeAPIBasicTestCase::testMenuNodeAPI in tests/menu_node.test
Tests for basic internal module functions.

File

tests/menu_node.test, line 64
Simpletest for Menu Node API.

Class

MenuNodeAPITestCase
Utility test class that provides methods for other tests.

Code

public function menuNodeAPICreateItems($count = 3) {
  for ($i = 0; $i < $count; $i++) {
    $item = array(
      'menu_name' => 'navigation',
      'link_path' => "<front>",
      'link_title' => $this
        ->randomName(12),
      'description' => '',
      'enabled' => 1,
      'expanded' => 0,
      'parent' => 'navigation' . ':' . 0,
      'weight' => '0',
    );
    menu_link_save($item);
  }
}