public function RegressionTest::testDBFieldExists in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBFieldExists()
Tests the \Drupal\Core\Database\Schema::fieldExists() method.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ RegressionTest.php, line 48
Class
- RegressionTest
- Regression tests cases for the database layer.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testDBFieldExists() {
$schema = $this->connection
->schema();
$this
->assertTrue($schema
->fieldExists('test', 'name'), 'Returns true for existent column.');
$this
->assertFalse($schema
->fieldExists('test', 'no_such_column'), 'Returns false for nonexistent column.');
}