function RegressionTest::testDBIndexExists

Same name in other branches
  1. 9 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBIndexExists()
  2. 10 core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBIndexExists()
  3. 11.x core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php \Drupal\KernelTests\Core\Database\RegressionTest::testDBIndexExists()

Tests the Schema::indexExists() method.

File

core/tests/Drupal/KernelTests/Core/Database/RegressionTest.php, line 57

Class

RegressionTest
Regression tests cases for the database layer.

Namespace

Drupal\KernelTests\Core\Database

Code

public function testDBIndexExists() {
    $this->assertSame(TRUE, $this->connection
        ->schema()
        ->indexExists('test', 'ages'), 'Returns true for existent index.');
    $this->assertSame(FALSE, $this->connection
        ->schema()
        ->indexExists('test', 'nosuchindex'), 'Returns false for nonexistent index.');
}

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