class UpdateEnableProviderDatabaseDriverTest

Tests that update hooks are enabling the database driver providing module.

@group Update

Hierarchy

Expanded class hierarchy of UpdateEnableProviderDatabaseDriverTest

File

core/modules/system/tests/src/Functional/Update/UpdateEnableProviderDatabaseDriverTest.php, line 13

Namespace

Drupal\Tests\system\Functional\Update
View source
class UpdateEnableProviderDatabaseDriverTest extends UpdatePathTestBase {
  
  /**
   * {@inheritdoc}
   */
  protected $defaultTheme = 'stark';
  
  /**
   * {@inheritdoc}
   */
  protected function setDatabaseDumpFiles() {
    $this->databaseDumpFiles = [
      __DIR__ . '/../../../fixtures/update/drupal-8.8.0.bare.standard.php.gz',
    ];
  }
  
  /**
   * Tests that post update hooks are properly run.
   */
  public function testPostUpdateEnableProviderDatabaseDriverHook() {
    $connection = Database::getConnection();
    $provider = $connection->getProvider();
    $this->assertFalse(\Drupal::moduleHandler()->moduleExists($provider));
    // Running the updates enables the module that is providing the database
    // driver.
    $this->runUpdates();
    $this->assertTrue(\Drupal::moduleHandler()->moduleExists($provider));
  }

}

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