Skip to content

Commit b3b7df3

Browse files
committed
Better messages. Proper cleanup of tests.
1 parent 23d91a8 commit b3b7df3

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

src/Factories/Password.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ function __construct(string $path)
2020
{
2121
consoleOutput()->info('Applying password and encryption to zip...');
2222

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

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

3232
$this->path = $path;
3333
}

tests/BackupShieldTests.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,17 @@ public static function tearDownAfterClass()
8787
{
8888
// Delete config and test-files
8989
unlink(__DIR__ . '/resources/processed.zip');
90-
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php');
90+
91+
$configTestPath = __DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php';
92+
if (file_exists($configTestPath)) {
93+
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/laravel/config/backup-shield.php');
94+
}
95+
96+
$configTestPathAlt = __DIR__ . '/../vendor/orchestra/testbench-core/fixture/config/backup-shield.php';
97+
if (file_exists($configTestPathAlt)) {
98+
unlink(__DIR__ . '/../vendor/orchestra/testbench-core/fixture/config/backup-shield.php');
99+
}
100+
91101
parent::tearDownAfterClass();
92102
}
93103
}

0 commit comments

Comments
 (0)