+ public function test_backup_using_database_credentials_with_special_chars()
+ {
+ // The user details used here is created as part of the database docker-mysql-init.sql script.
+ chdir('/var/www/bookstack');
+ $this->assertCount(0, glob('storage/backups/bookstack-backup-*.zip'));
+
+ $result = $this->runCommand('backup', [], [], [
+ 'DB_USERNAME' => 'testuser',
+ 'DB_PASSWORD' => 'a#pass${}with\tspe\'cial\nch"ars',
+ ]);
+ $result->assertSuccessfulExit();
+ $result->assertStdoutContains("Backup finished.");
+
+ $this->assertCount(1, glob('storage/backups/bookstack-backup-*.zip'));
+
+ $zipFile = glob('storage/backups/bookstack-backup-*.zip')[0];
+ unlink($zipFile);
+ }
+