function RegressionTest::testDBFieldExists

Tests the db_field_exists() function.

File

drupal/core/modules/system/lib/Drupal/system/Tests/Database/RegressionTest.php, line 58
Definition of Drupal\system\Tests\Database\RegressionTest.

Class

RegressionTest
Tests for database regressions.

Namespace

Drupal\system\Tests\Database

Code

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