protected function ForumAccessBaseTestCase::assertButton in Forum Access 7
Pass if a button with the specified label is found, and optional with the specified index.
Parameters
$label: Text in the value attribute.
$index: Link position counting from zero.
$message: Message to display.
$group: The group this message belongs to, defaults to 'Other'.
Return value
TRUE if the assertion succeeded, FALSE otherwise.
1 call to ForumAccessBaseTestCase::assertButton()
- ForumAccessBaseTestCase::checkForum in tests/
forum_access_test_base.php - Check the set of permissions in one forum.
File
- tests/
forum_access_test_base.php, line 265 - Base class with auxiliary functions for forum access module tests.
Class
- ForumAccessBaseTestCase
- Base test class for the Forum Access module.
Code
protected function assertButton($label, $index = 0, $message = '', $group = 'Other') {
$links = $this
->xpath('//input[contains(@type, submit)][contains(@value, :label)]', array(
':label' => $label,
));
$message = $message ? $message : t('Button with label %label found.', array(
'%label' => $label,
));
return $this
->assert(isset($links[$index]), $message, $group);
}