chore(tests): UT for XmlVerify service

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-02-17 09:16:46 +01:00
parent 3e313e85ef
commit d020963eaa
13 changed files with 914 additions and 389 deletions

View File

@@ -34,7 +34,7 @@ use SP\Domain\Core\Acl\UnauthorizedPageException;
use SP\Domain\Core\Exceptions\SessionTimeout;
use SP\Domain\Core\Exceptions\SPException;
use SP\Domain\Export\Ports\XmlExportService;
use SP\Domain\Export\Ports\XmlVerifyServiceInterface;
use SP\Domain\Export\Ports\XmlVerifyService;
use SP\Http\JsonMessage;
use SP\Infrastructure\File\ArchiveHandler;
use SP\Infrastructure\File\DirectoryHandler;
@@ -50,13 +50,13 @@ final class XmlExportController extends SimpleControllerBase
use JsonTrait;
private XmlExportService $xmlExportService;
private XmlVerifyServiceInterface $xmlVerifyService;
private XmlVerifyService $xmlVerifyService;
public function __construct(
Application $application,
SimpleControllerHelper $simpleControllerHelper,
XmlExportService $xmlExportService,
XmlVerifyServiceInterface $xmlVerifyService
XmlVerifyService $xmlVerifyService
) {
parent::__construct($application, $simpleControllerHelper);
@@ -94,10 +94,7 @@ final class XmlExportController extends SimpleControllerBase
if (!empty($exportPassword)) {
$verifyResult =
$this->xmlVerifyService->verifyEncrypted(
$file,
$exportPassword
);
$this->xmlVerifyService->verify($file, $exportPassword);
} else {
$verifyResult = $this->xmlVerifyService->verify($file);
}