You are here

function BotchaBaseWebTestCase::getButtonsByForm in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::getButtonsByForm()
  2. 7.2 botcha.test \BotchaBaseWebTestCase::getButtonsByForm()
  3. 7.3 tests/botcha.simpletest.test \BotchaBaseWebTestCase::getButtonsByForm()

Get the list of names of the buttons that are available for this concrete form. Used as "modes" for behavior testing. Later we check that the real behavior after clicking this button matches our suspections.

1 call to BotchaBaseWebTestCase::getButtonsByForm()
BotchaTestCase::testFormSubmission in ./botcha.test

File

./botcha.test, line 246
Tests for BOTCHA module.

Class

BotchaBaseWebTestCase
Base class for BOTCHA tests.

Code

function getButtonsByForm($form) {
  $buttons = array();
  switch ($form) {
    case 'user_login':
      $buttons[] = t('Log in');
      break;
    case 'node':
    case 'comment':
    default:
      $buttons[] = t('Preview');
      $buttons[] = t('Save');
      break;
  }
  return $buttons;
}