function RegressionTest::testDBTableExists
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBTableExists()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBTableExists()
- 11.x core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBTableExists()
Tests the Schema::tableExists() method.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ RegressionTest.php, line 40
Class
- RegressionTest
- Regression tests cases for the database layer.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testDBTableExists() : void {
$this->assertTrue($this->connection
->schema()
->tableExists('test'), 'Returns true for existent table.');
$this->assertFalse($this->connection
->schema()
->tableExists('no_such_table'), 'Returns false for nonexistent table.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.