function ClassyUninstallUpdateTest::testUpdateClassyNeeded

Ensures that updates run without errors when Classy is still needed.

File

core/modules/system/tests/src/Functional/Update/ClassyUninstallUpdateTest.php, line 75

Class

ClassyUninstallUpdateTest
Ensures that update hook uninstalls Classy when it's no longer needed.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testUpdateClassyNeeded() {
    
    /** @var \Drupal\Core\Extension\ThemeHandlerInterface $theme_handler */
    $theme_handler = $this->container
        ->get('theme_handler');
    
    /** @var \Drupal\Core\Extension\ThemeInstallerInterface $theme_installer */
    $theme_installer = $this->container
        ->get('theme_installer');
    $theme_installer->install([
        'test_legacy_stylesheets_remove',
    ]);
    $this->assertTrue($theme_handler->themeExists('classy'));
    $this->runUpdates();
    // Ensure that Classy is still installed after running tests.
    $theme_handler->refreshInfo();
    $this->assertTrue($theme_handler->themeExists('classy'));
}

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