class AssetCompressUpdatePathTest

Same name and namespace in other branches
  1. 11.x core/modules/system/tests/src/Functional/Update/AssetCompressUpdatePathTest.php \Drupal\Tests\system\Functional\Update\AssetCompressUpdatePathTest

Tests the upgrade path renaming system.performance gzip keys to compress.

Attributes

#[Group('Update')] #[RunTestsInSeparateProcesses]

Hierarchy

Expanded class hierarchy of AssetCompressUpdatePathTest

File

core/modules/system/tests/src/Functional/Update/AssetCompressUpdatePathTest.php, line 14

Namespace

Drupal\Tests\system\Functional\Update
View source
class AssetCompressUpdatePathTest extends UpdatePathTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() : void {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../../../system/tests/fixtures/update/drupal-11.3.0.bare.standard.php.gz',
      __DIR__ . '/../../../../tests/fixtures/update/install-mysqli.php',
    ];
  }
  
  /**
   * Tests the upgrade path for renaming gzip keys to compress.
   */
  public function testRunUpdates() : void {
    $config = \Drupal::config('system.performance');
    $this->assertIsBool($config->get('css.gzip'));
    $this->assertIsBool($config->get('js.gzip'));
    $this->runUpdates();
    $config = \Drupal::config('system.performance');
    $this->assertNull($config->get('css.gzip'));
    $this->assertNull($config->get('js.gzip'));
    $this->assertIsBool($config->get('css.compress'));
    $this->assertIsBool($config->get('js.compress'));
  }

}

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