function UpdateScriptTest::testThemeSystem

Same name and namespace in other branches
  1. 9 core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::testThemeSystem()
  2. 8.9.x core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::testThemeSystem()
  3. 10 core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php \Drupal\Tests\system\Functional\UpdateSystem\UpdateScriptTest::testThemeSystem()

Tests the effect of using the update script on the theme system.

File

core/modules/system/tests/src/Functional/UpdateSystem/UpdateScriptTest.php, line 657

Class

UpdateScriptTest
Tests the update script access and functionality.

Namespace

Drupal\Tests\system\Functional\UpdateSystem

Code

public function testThemeSystem() : void {
    // Since visiting update.php triggers a rebuild of the theme system from an
    // unusual maintenance mode environment, we check that this rebuild did not
    // put any incorrect information about the themes into the database.
    $original_theme_data = $this->config('core.extension')
        ->get('theme');
    $this->drupalLogin($this->updateUser);
    $this->drupalGet($this->updateUrl, [
        'external' => TRUE,
    ]);
    $final_theme_data = $this->config('core.extension')
        ->get('theme');
    $this->assertEquals($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.');
}

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