You are here

public function BackupMigrateQuickBackupTest::setUp in Backup and Migrate 5.0.x

Same name and namespace in other branches
  1. 8.4 tests/src/Functional/BackupMigrateQuickBackupTest.php \Drupal\Tests\backup_migrate\Functional\BackupMigrateQuickBackupTest::setUp()

Overrides BrowserTestBase::setUp

File

tests/src/Functional/BackupMigrateQuickBackupTest.php, line 35

Class

BackupMigrateQuickBackupTest
Tests backup migrate quick backup functionality.

Namespace

Drupal\Tests\backup_migrate\Functional

Code

public function setUp() : void {
  parent::setUp();

  // Ensure backup_migrate folder exists.
  $path = 'private://backup_migrate/';
  \Drupal::service('file_system')
    ->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);

  // Log in as an admin.
  $this
    ->drupalLogin($this
    ->drupalCreateUser([
    'perform backup',
    'access backup files',
    'administer backup and migrate',
    // Required for the file admin page.
    'administer site configuration',
  ]));
  $this
    ->drupalGet('admin/config/media/file-system');
}