You are here

public function RegressionTest::testDBTableExists in Drupal 8

Same name and namespace in other branches
  1. 9 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.');
}