mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-18 22:36:49 +01:00
test(IT): Setup integration tests
Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
@@ -26,6 +26,9 @@ namespace SP\Modules\Web\Controllers\ConfigBackup;
|
||||
|
||||
|
||||
use Exception;
|
||||
use SP\Core\Application;
|
||||
use SP\Core\Bootstrap\Path;
|
||||
use SP\Core\Bootstrap\PathsContext;
|
||||
use SP\Core\Context\Session;
|
||||
use SP\Core\Events\Event;
|
||||
use SP\Core\Events\EventMessage;
|
||||
@@ -38,6 +41,10 @@ use SP\Domain\Export\Dtos\BackupType;
|
||||
use SP\Infrastructure\File\FileHandler;
|
||||
use SP\Modules\Web\Controllers\SimpleControllerBase;
|
||||
use SP\Modules\Web\Controllers\Traits\JsonTrait;
|
||||
use SP\Mvc\Controller\SimpleControllerHelper;
|
||||
|
||||
use function SP\__u;
|
||||
use function SP\processException;
|
||||
|
||||
/**
|
||||
* Class DownloadBackupController
|
||||
@@ -46,6 +53,15 @@ final class DownloadBackupAppController extends SimpleControllerBase
|
||||
{
|
||||
use JsonTrait;
|
||||
|
||||
public function __construct(
|
||||
Application $application,
|
||||
SimpleControllerHelper $simpleControllerHelper,
|
||||
private readonly PathsContext $pathsContext
|
||||
) {
|
||||
parent::__construct($application, $simpleControllerHelper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
@@ -58,7 +74,12 @@ final class DownloadBackupAppController extends SimpleControllerBase
|
||||
try {
|
||||
Session::close();
|
||||
|
||||
$filePath = new BackupFile(BackupType::app, $this->configData->getBackupHash(), BACKUP_PATH, 'gz');
|
||||
$filePath = new BackupFile(
|
||||
BackupType::app,
|
||||
$this->configData->getBackupHash(),
|
||||
$this->pathsContext[Path::BACKUP],
|
||||
'gz'
|
||||
);
|
||||
|
||||
$file = new FileHandler((string)$filePath);
|
||||
$file->checkFileExists();
|
||||
|
||||
Reference in New Issue
Block a user