Skip to content

Commit

Permalink
Better messages. Proper cleanup of tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
olssonm committed Jun 5, 2018
1 parent 23d91a8 commit b3b7df3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Factories/Password.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ function __construct(string $path)
{
consoleOutput()->info('Applying password and encryption to zip...');

// Create a new zip, add the zip from spatie/backup, encrypt and resave
// Create a new zip, add the zip from spatie/backup, encrypt and resave/overwrite
$zipFile = new ZipFile();
$zipFile->addFile($path, 'backup.zip', ZipFile::METHOD_DEFLATED);
$zipFile->setPassword(config('backup-shield.password'), config('backup-shield.encryption'));
$zipFile->saveAsFile($path);
$zipFile->close();

consoleOutput()->info('Applied password and encryption to zip.');
consoleOutput()->info('Successfully applied password and encryption to zip.');

$this->path = $path;
}
Expand Down
12 changes: 11 additions & 1 deletion tests/BackupShieldTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,17 @@ public static function tearDownAfterClass()
{
// Delete config and test-files
unlink(__DIR__ . '/resources/processed.zip');
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php');

$configTestPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php';
if (file_exists($configTestPath)) {
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php');
}

$configTestPathAlt = __DIR__ . '/../vendor/orchestra/testbench-core/fixture/config/backup-shield.php';
if (file_exists($configTestPathAlt)) {
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/fixture/config/backup-shield.php');
}

parent::tearDownAfterClass();
}
}

0 comments on commit b3b7df3

Please sign in to comment.