You are here

function DatabaseRegressionTestCase::testDBFieldExists in Drupal 7

Test the db_field_exists() function.

File

modules/simpletest/tests/database_test.test, line 2948

Class

DatabaseRegressionTestCase
Regression tests.

Code

function testDBFieldExists() {
  $this
    ->assertIdentical(TRUE, db_field_exists('node', 'nid'), 'Returns true for existent column.');
  $this
    ->assertIdentical(FALSE, db_field_exists('node', 'nosuchcolumn'), 'Returns false for nonexistent column.');
}