test(IT): Setup integration tests

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-07-27 11:10:50 +02:00
parent 545631a880
commit d3c6448295
121 changed files with 3329 additions and 2878 deletions

View File

@@ -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();