function RegressionTest::testDBTableExists

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBTableExists()
  2. 10 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBTableExists()
  3. 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\Database

Code

public function testDBTableExists() {
    $this->assertSame(TRUE, $this->connection
        ->schema()
        ->tableExists('test'), 'Returns true for existent table.');
    $this->assertSame(FALSE, $this->connection
        ->schema()
        ->tableExists('nosuchtable'), 'Returns false for nonexistent table.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.