]> BookStack Code Mirror - system-cli/blobdiff - tests/Commands/RestoreCommandTest.php
Added path check/validation for provided restore file path
[system-cli] / tests / Commands / RestoreCommandTest.php
index 868b9aefd826ce6350f2a3acb314117e9339967a..17b9dd50a27dbce34eaefecad875c96456c2ea92 100644 (file)
@@ -167,6 +167,18 @@ class RestoreCommandTest extends TestCase
         exec('rm -rf /symlinks');
     }
 
+    public function test_restore_with_invalid_zip_path_shows_warning()
+    {
+        chdir('/var/www/bookstack');
+
+        $result = $this->runCommand('restore', [
+            'backup-zip' => '/cats/dogs.zip',
+            '--app-directory' => '/var/www/bookstack',
+        ]);
+
+        $result->assertStderrContains("Could not find ZIP file for restoration at provided path [/cats/dogs.zip].");
+    }
+
     protected function buildZip(callable $builder): string
     {
         $zipFile = tempnam(sys_get_temp_dir(), 'cli-test');