You are here

function vars_test_search_variable in Variable API 7.2

Same name and namespace in other branches
  1. 6.2 tests/vars.test \vars_test_search_variable()
  2. 6 tests/vars.test \vars_test_search_variable()
  3. 7 tests/vars.test \vars_test_search_variable()

Checks the variables table doesn't contain a value for the Drupal variable passed as argument.

Parameters

$name: The name of the Drupal variable.

Return value

TRUE, if the table contains the default value for the Drupal variable.

4 calls to vars_test_search_variable()
VarsExtendedTestCase::testDeletingVars in tests/vars.test
VarsExtendedTestCase::testRenamingVars in tests/vars.test
VarsExtendedTestCase::testWritingVars in tests/vars.test
VarsModuleUninstallationTestCase::testModuleUninstallation in tests/vars.test

File

tests/vars.test, line 361
Test file for the Variable API module.

Code

function vars_test_search_variable($name) {
  return (bool) db_query_range('SELECT 1 FROM {variable} WHERE name = :name', 0, 1, array(
    ':name' => $name,
  ))
    ->fetchField();
}