Skip to content

Commit

Permalink
Merge pull request #101 from argiepiano/1.x-1.x-issue-98
Browse files Browse the repository at this point in the history
Issue #98. Fix failing tests.
  • Loading branch information
argiepiano authored Sep 24, 2023
2 parents de8d6e9 + af11c5d commit 17c95c5
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 40 deletions.
80 changes: 40 additions & 40 deletions tests/BmTestProfiles.test
Original file line number Diff line number Diff line change
Expand Up @@ -38,46 +38,46 @@ class BmTestProfiles extends BmTestBase {
/**
* Confirm adding a new backup process works.
*/
// public function testAddDefaultProfile() {
// require_once dirname(__FILE__) . '/../includes/files.inc';
// require_once dirname(__FILE__) . '/../includes/profiles.inc';

// // Load the main B&M page.
// $this->backdropGet(BACKUP_MIGRATE_MENU_PATH . '/settings/profile/add');
// $this->assertResponse(200);

// $filename = _backup_migrate_default_filename();
// $defaults = _backup_migrate_profile_default_profile();

// // Verify all of the expected fields exist.
// $this->assertFieldByName('name');
// $this->assertFieldByName('name', 'Untitled Profile');
// $this->assertFieldByName('machine_name');
// $this->assertFieldByName('filename');
// $this->assertFieldByName('filename', $filename);
// // @todo Confirm all of the expected options are present.
// $this->assertFieldByName('append_timestamp');
// $this->assertFieldByName('timestamp_format');
// $this->assertFieldByName('timestamp_format', $defaults['timestamp_format']);
// $this->assertFieldByName('filters[compression]');
// $items = $this->supportedCompressors();
// $this->assertSelectOptions('edit-filters-compression', $items);
// $this->assertOptionSelected('edit-filters-compression', 'gzip');
// $this->assertFieldByName('filters[sources][db][exclude_tables][]');
// $this->assertFieldByName('filters[sources][db][nodata_tables][]');
// $this->assertFieldByName('filters[sources][db][utils_lock_tables]');
// $this->assertFieldByName('filters[sources][files][exclude_filepaths]');
// $this->assertFieldByName('filters[sources][archive][exclude_filepaths]');
// $this->assertFieldByName('filters[utils_site_offline]');
// $this->assertFieldByName('filters[utils_site_offline_message]');
// $this->assertFieldByName('filters[utils_description]');
// $this->assertFieldByName('filters[use_cli]');
// $this->assertFieldByName('filters[ignore_errors]');
// $this->assertFieldByName('filters[notify_success_enable]');
// $this->assertFieldByName('filters[notify_success_email]');
// $this->assertFieldByName('filters[notify_failure_enable]');
// $this->assertFieldByName('filters[notify_failure_email]');
// }
public function testAddDefaultProfile() {
require_once dirname(__FILE__) . '/../includes/files.inc';
require_once dirname(__FILE__) . '/../includes/profiles.inc';

// Load the main B&M page.
$this->backdropGet(BACKUP_MIGRATE_MENU_PATH . '/settings/profile/add');
$this->assertResponse(200);

$filename = _backup_migrate_default_filename();
$defaults = _backup_migrate_profile_default_profile();

// Verify all of the expected fields exist.
$this->assertFieldByName('name');
$this->assertFieldByName('name', 'Untitled Profile');
$this->assertFieldByName('machine_name');
$this->assertFieldByName('filename');
$this->assertFieldByName('filename', $filename);
// @todo Confirm all of the expected options are present.
$this->assertFieldByName('append_timestamp');
$this->assertFieldByName('timestamp_format');
$this->assertFieldByName('timestamp_format', $defaults['timestamp_format']);
$this->assertFieldByName('filters[compression]');
$items = $this->supportedCompressors();
$this->assertSelectOptions('edit-filters-compression', $items);
$this->assertOptionSelected('edit-filters-compression', 'gzip');
$this->assertFieldByName('filters[sources][db][exclude_tables][]');
$this->assertFieldByName('filters[sources][db][nodata_tables][]');
$this->assertFieldByName('filters[sources][db][utils_lock_tables]');
$this->assertFieldByName('filters[sources][files][exclude_filepaths]');
$this->assertFieldByName('filters[sources][archive][exclude_filepaths]');
$this->assertFieldByName('filters[utils_site_offline]');
$this->assertFieldByName('filters[utils_site_offline_message]');
$this->assertFieldByName('filters[utils_description]');
$this->assertFieldByName('filters[use_cli]');
$this->assertFieldByName('filters[ignore_errors]');
$this->assertFieldByName('filters[notify_success_enable]');
$this->assertFieldByName('filters[notify_success_email]');
$this->assertFieldByName('filters[notify_failure_enable]');
$this->assertFieldByName('filters[notify_failure_email]');
}

/**
* Confirm the backup filename processes work as expected.
Expand Down
7 changes: 7 additions & 0 deletions tests/files/test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
�Nay, Traveller! rest. This lonely yew-tree stands
Far from all human dwelling: what if here
No sparkling rivulet spread the verdant herb;
What if these barren boughs the bee not loves;
Yet, if the wind breathe soft, the curling waves,
That break against the shore, shall lull thy mind
By one soft impulse saved from vacancy.

0 comments on commit 17c95c5

Please sign in to comment.