class ProfileAutoUninstallFailureTest

Same name and namespace in other branches
  1. 11.x core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallFailureTest.php \Drupal\FunctionalTests\Installer\ProfileAutoUninstallFailureTest

Tests that profile-provided dependencies thwart auto-uninstall.

Attributes

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

Hierarchy

Expanded class hierarchy of ProfileAutoUninstallFailureTest

File

core/tests/Drupal/FunctionalTests/Installer/ProfileAutoUninstallFailureTest.php, line 13

Namespace

Drupal\FunctionalTests\Installer
View source
class ProfileAutoUninstallFailureTest extends InstallerTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected $profile = 'testing_auto_uninstall_has_dependencies';
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * {@inheritdoc}
   */
  protected function setUpSite() : void {
    try {
      parent::setUpSite();
      $this->fail('Expected an exception due to an in-use dependency.');
    } catch (\Throwable $e) {
      $this->assertStringContainsString("The install profile 'Testing - Automatic uninstall failure' is providing the following module(s): testing_in_use_dependency", $e->getMessage());
    }
  }
  
  /**
   * Tests that the profile cannot be automatically uninstalled.
   */
  public function testAutomaticUninstallFailure() : void {
    // Everything we're testing here happens in setUpSite().
  }

}

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