You are here

function BackupMigrateUnitTest::testDefaultFileName in Backup and Migrate 5

File

tests/BackupMigrateUnitTest.test, line 281

Class

BackupMigrateUnitTest
Unit tests for Backup and Migrate module.

Code

function testDefaultFileName() {

  // with token
  $this
    ->drupalModuleEnable('token');
  $name = _backup_migrate_default_file_name();
  $this
    ->assertEqual($name, '[site-name]', t('Checking default filename is site-name token'));

  // without token
  $this
    ->drupalModuleDisable('token');
  $sitename = $this
    ->randomName(5, 'site_');
  $this
    ->drupalVariableSet('site_name', $sitename);
  $name = _backup_migrate_default_file_name();
  $this
    ->assertEqual($name, $sitename, t('Checking default filename is the site name'));
}