protected function AsafBaseTestCase::getButtons in Asaf (ajax submit for any form) 8
Same name and namespace in other branches
- 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
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;
}