You are here

protected function og_menu_singleMenuItemNodeCreateTest::gatherMenuOptions in OG Menu Single 7

1 call to og_menu_singleMenuItemNodeCreateTest::gatherMenuOptions()
og_menu_singleMenuItemNodeCreateTest::testMenuLinkCreated in tests/og_menu_singleBase.test
Test skipping OgBehaviorHandler.

File

tests/og_menu_singleBase.test, line 102
Provides a base unit test class.

Class

og_menu_singleMenuItemNodeCreateTest

Code

protected function gatherMenuOptions() {
  $options = array();
  $parent = 0;
  foreach ($this
    ->xpath('//select[@id="edit-menu-parent"]//option') as $option) {
    list($menu_name, $mlid) = explode(':', (string) $option['value']);
    if ($menu_name == OG_MENU_SINGLE_MENU_NAME) {
      $title = (string) $option[0];
      if (strpos($title, '<Group Menu>') === 0) {
        continue;
      }
      elseif (strpos($title, '-- ') === 0) {
        $parent = $mlid;
      }
      else {
        $options[$parent][$mlid] = $title;
      }
    }
  }
  return $options;
}