BlockContentReusableIndexUpdatePathTest.php

Same filename in other branches
  1. 11.x core/modules/block_content/tests/src/Functional/Update/BlockContentReusableIndexUpdatePathTest.php

Namespace

Drupal\Tests\block_content\Functional\Update

File

core/modules/block_content/tests/src/Functional/Update/BlockContentReusableIndexUpdatePathTest.php

View source
<?php

declare (strict_types=1);
namespace Drupal\Tests\block_content\Functional\Update;

use Drupal\Core\Database\Database;
use Drupal\FunctionalTests\Update\UpdatePathTestBase;

/**
 * Tests the upgrade path for Block Content reusable column index.
 *
 * @group block_content
 */
class BlockContentReusableIndexUpdatePathTest extends UpdatePathTestBase {
    
    /**
     * {@inheritdoc}
     */
    protected function setDatabaseDumpFiles() : void {
        $this->databaseDumpFiles = [
            __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-9.4.0.bare.standard.php.gz',
        ];
    }
    
    /**
     * Tests the upgrade path for Block Content reusable index.
     */
    public function testRunUpdates() : void {
        $connection = Database::getConnection();
        $this->assertFalse($connection->schema()
            ->indexExists('block_content_field_data', 'block_content_field__reusable'), 'Block Content reusable index not yet added.');
        $this->runUpdates();
        $this->assertTrue($connection->schema()
            ->indexExists('block_content_field_data', 'block_content_field__reusable'), 'Block Content reusable index has been added.');
    }

}

Classes

Title Deprecated Summary
BlockContentReusableIndexUpdatePathTest Tests the upgrade path for Block Content reusable column index.

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