You are here

protected function AsafBaseTestCase::getButtons in Asaf (ajax submit for any form) 8

Same name and namespace in other branches
  1. 7 tests/asaf.test \AsafBaseTestCase::getButtons()
2 calls to AsafBaseTestCase::getButtons()
AsafCommonTests::testAjaxButtons in tests/asaf.test
AsafCommonTests::testFormSubmit in tests/asaf.test

File

tests/asaf.test, line 8

Class

AsafBaseTestCase

Code

protected function getButtons($formId = NULL) {
  $buttons = array();
  $xpath = '//input[@type="submit"]';
  if (isset($formId)) {
    $xpath = '//form[@id="' . $formId . '"]' . $xpath;
  }
  $elements = $this
    ->xpath($xpath);
  foreach ($elements as $element) {
    $id = (string) $element['id'];
    $buttons[$id] = $id;
  }
  return $buttons;
}