function StableUninstallUpdateTest::testUpdateStableNeeded

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

File

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

Class

StableUninstallUpdateTest
Ensures that update hook uninstalls Stable when it's no longer needed.

Namespace

Drupal\Tests\system\Functional\Update

Code

public function testUpdateStableNeeded() {
  /** @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_theme_depending_on_stable',
  ]);
  $this->assertTrue($theme_handler->themeExists('stable'));
  $this->runUpdates();
  // Ensure that Stable is still installed after running tests.
  $theme_handler->refreshInfo();
  $this->assertTrue($theme_handler->themeExists('stable'));
}

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