You are here

function MenuImportTestCase::getFormHiddenFields in Menu Export/Import 7

1 call to MenuImportTestCase::getFormHiddenFields()
MenuImportTestCase::testBasicFeatures in ./menu_import.test
Verifies basic functionality by running two imports - the first creates menu links and new nodes referenced by them, the other one reorders existing menu items searching for existing content by title.

File

./menu_import.test, line 238
Test file for menu_import module.

Class

MenuImportTestCase
Functionality tests for menu_import module.

Code

function getFormHiddenFields() {
  $fields = array();
  $elements = $this
    ->xpath("//input[@type='hidden']");
  foreach ($elements as $element) {
    $attrs = $element
      ->attributes();
    $name = $value = '';
    foreach ($attrs as $aname => $avalue) {
      if ($aname == 'name') {
        $name = $avalue;
      }
      if ($aname == 'value') {
        $value = $avalue;
      }
    }
    $fields["{$name}"] = "{$value}";
  }
  return $fields;
}