function SchemaIntrospectionTestTrait::assertNoIndexOnColumns

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

Checks that an index covering exactly the given column names doesn't exist.

Parameters

string $table_name: A non-prefixed table name.

array $column_names: An array of column names

string $index_type: (optional) The type of the index. Can be one of 'index', 'unique' or 'primary'. Defaults to 'index'.

1 call to SchemaIntrospectionTestTrait::assertNoIndexOnColumns()
TaxonomyVocabularyHierarchyUpdateTest::testTaxonomyUpdateParents in core/modules/taxonomy/tests/src/Functional/Update/TaxonomyVocabularyHierarchyUpdateTest.php
Tests that the 'hierarchy' property is removed from vocabularies.

File

core/tests/Drupal/Tests/Core/Database/SchemaIntrospectionTestTrait.php, line 42

Class

SchemaIntrospectionTestTrait
Provides methods for testing database schema characteristics.

Namespace

Drupal\Tests\Core\Database

Code

protected function assertNoIndexOnColumns($table_name, array $column_names, $index_type = 'index') {
    foreach ($this->getIndexColumnNames($table_name, $index_type) as $index_columns) {
        if ($column_names == $index_columns) {
            $this->assertTrue(FALSE);
        }
    }
    $this->assertTrue(TRUE);
}

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