You are here

function SpacesMenuTestCase::getMenuOrder in Spaces 7.3

Same name and namespace in other branches
  1. 6.3 tests/spaces.test \SpacesMenuTestCase::getMenuOrder()
  2. 7 tests/spaces.test \SpacesMenuTestCase::getMenuOrder()
1 call to SpacesMenuTestCase::getMenuOrder()
SpacesMenuTestCase::testMenuOrdering in tests/spaces.test

File

tests/spaces.test, line 339

Class

SpacesMenuTestCase
Test for menu re-ordering

Code

function getMenuOrder() {
  $base_path = base_path();
  $elems = $this
    ->xpath('//ul[@id="main-menu-links"] /li /a');
  $links = array();
  foreach ($elems as $e) {
    foreach ($e
      ->attributes() as $k => $v) {
      if ($k == 'href') {
        $links[] = $base_path . substr($v . '', 1);
      }
    }
  }
  return $links;
}