Error message
You are browsing documentation for drupal 7.x, which is not supported anymore. Read the updated version of this page for drupal 11.x (the latest version).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.