function ContentModerationStateIndexUpdatePathTest::testRunUpdates

Tests the upgrade path for moderation state index.

File

core/modules/content_moderation/tests/src/Functional/Update/ContentModerationStateIndexUpdatePathTest.php, line 30

Class

ContentModerationStateIndexUpdatePathTest
Tests the upgrade path for adding an index to moderation state column.

Namespace

Drupal\Tests\content_moderation\Functional\Update

Code

public function testRunUpdates() : void {
  $table = 'content_moderation_state_field_revision';
  $name = 'content_moderation_state__moderation_state';
  $connection = Database::getConnection();
  $this->assertFalse($connection->schema()
    ->indexExists($table, $name));
  $this->runUpdates();
  $this->assertTrue($connection->schema()
    ->indexExists($table, $name));
}

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