You are here

protected function BmTestBase::runBackup in Backup and Migrate 7.3

Run a specific backup.

Parameters

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

string $source_id: The ID of the source to check. Defaults to the database.

2 calls to BmTestBase::runBackup()
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 155
Shared functionality to make the rest of the tests simpler.

Class

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

Code

protected function runBackup($destination_id = 'manual', $source_id = 'db') {
  $this
    ->drupalGet(BACKUP_MIGRATE_MENU_PATH);
  $this
    ->assertResponse(200);
  $edit = array(
    'destination_id' => $destination_id,
    'source_id' => $source_id,
  );
  $this
    ->drupalPost(NULL, $edit, 'Backup now');
  $this
    ->assertResponse(200);

  // Confirm the response is as expected. This is split up into separate
  // pieces because it'd be more effort than is necessary right now to confirm
  // what the exact filename is.
  if ($source_id === 'db') {
    $this
      ->assertText('Default Database backed up successfully');
  }
  else {
    $this
      ->assertText(' backed up successfully');
  }
  $this
    ->assertText('in destination');
  if ($source_id === 'db') {
    $this
      ->assertLink('download');
    $this
      ->assertLink('restore');
    $this
      ->assertLink('delete');
  }
}