function DatabaseRegressionTestCase::testDBFieldExists

Test the db_field_exists() function.

File

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

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.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.