You are here

public function InPlaceUpdateTest::testCoreRollbackUpdate in Automatic Updates 8

@covers ::update

File

tests/src/Build/InPlaceUpdateTest.php, line 63

Class

InPlaceUpdateTest
@coversDefaultClass \Drupal\automatic_updates\Services\InPlaceUpdate

Namespace

Drupal\Tests\automatic_updates\Build

Code

public function testCoreRollbackUpdate() {
  $from_version = '8.7.0';
  $to_version = '8.8.5';
  $this
    ->installCore($from_version);

  // Configure module to have db updates cause a rollback.
  $settings_php = $this
    ->getWorkspaceDirectory() . '/sites/default/settings.php';
  $fs = new SymfonyFilesystem();
  $fs
    ->chmod($this
    ->getWorkspaceDirectory() . '/sites/default', 0755);
  $fs
    ->chmod($settings_php, 0640);
  $fs
    ->appendToFile($settings_php, PHP_EOL . '$config[\'automatic_updates.settings\'][\'database_update_handling\'] = [\'rollback\'];' . PHP_EOL);
  $this
    ->assertCoreUpgradeFailed($from_version, $to_version);
}