1 database_test.test DatabaseRegressionTestCase::testDBFieldExists()

Test the db_field_exists() function.

File

core/modules/simpletest/tests/database_test.test, line 2784
Database tests.

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