You are here

private function BotchaAdminTestCase::getBotchaPointSettingFromDatabase in BOTCHA Spam Prevention 6

Same name and namespace in other branches
  1. 7 botcha.test \BotchaAdminTestCase::getBotchaPointSettingFromDatabase()

Helper function to get the BOTCHA point setting straight from the database.

Parameters

string $form_id:

Return value

stdClass object

2 calls to BotchaAdminTestCase::getBotchaPointSettingFromDatabase()
BotchaAdminTestCase::testBotchaPointAdministration in ./botcha.test
Method for testing the BOTCHA point administration
BotchaAdminTestCase::testBotchaPointAdministrationByNonAdmin in ./botcha.test
Method for testing the BOTCHA point administration

File

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

Class

BotchaAdminTestCase

Code

private function getBotchaPointSettingFromDatabase($form_id) {
  $result = db_query("SELECT * FROM {botcha_points} WHERE form_id = '%s'", $form_id);
  if (!$result) {
    return NULL;
  }
  $botcha_point = db_fetch_object($result);
  if (!$botcha_point) {
    return NULL;
  }
  return $botcha_point;
}