You are here

function RegressionTest::testDBIndexExists in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Tests/Database/RegressionTest.php \Drupal\system\Tests\Database\RegressionTest::testDBIndexExists()

Tests the db_index_exists() function.

File

core/modules/system/src/Tests/Database/RegressionTest.php, line 60
Contains \Drupal\system\Tests\Database\RegressionTest.

Class

RegressionTest
Regression tests cases for the database layer.

Namespace

Drupal\system\Tests\Database

Code

function testDBIndexExists() {
  $this
    ->assertIdentical(TRUE, db_index_exists('test', 'ages'), 'Returns true for existent index.');
  $this
    ->assertIdentical(FALSE, db_index_exists('test', 'nosuchindex'), 'Returns false for nonexistent index.');
}