You are here

protected function BmTestBase::deleteBackups in Backup and Migrate 7.3

Delete all of the files in a specific backup destination.

Parameters

string $destination_id: The ID of the destination to check. Defaults to the manual file path.

2 calls to BmTestBase::deleteBackups()
BmTestEmail::testAddEmailDestination in tests/BmTestEmail.test
Confirm the whole email process.
BmTestProfiles::testFilenameOptions in tests/BmTestProfiles.test
Confirm the backup filename processes work as expected.

File

tests/BmTestBase.test, line 187
Shared functionality to make the rest of the tests simpler.

Class

BmTestBase
Base class for testing a module's custom tags.

Code

protected function deleteBackups($destination_id = 'manual') {
  $destination = backup_migrate_get_destination($destination_id);
  $files = $this
    ->listBackupFiles($destination_id);
  if (!empty($files)) {
    foreach ($files as $file_id => $file) {
      $destination
        ->delete_file($file_id);
    }
  }
}