test(tests): UT for JsonResponse class

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2024-05-08 19:58:15 +02:00
parent c758b7f0b6
commit 9b170b2fb8
13 changed files with 264 additions and 116 deletions

View File

@@ -31,6 +31,7 @@ use SP\Core\PhpExtensionChecker;
use SP\Domain\Config\Ports\ConfigDataInterface;
use SP\Domain\Config\Services\ConfigFile;
use SP\Domain\Core\Acl\UnauthorizedPageException;
use SP\Domain\Core\Bootstrap\RouteContextData;
use SP\Domain\Core\Bootstrap\UriContextInterface;
use SP\Domain\Core\Context\Context;
use SP\Domain\Core\Exceptions\SessionTimeout;
@@ -56,6 +57,8 @@ abstract class SimpleControllerBase
protected readonly PhpExtensionChecker $extensionChecker;
protected readonly ConfigDataInterface $configData;
protected readonly UriContextInterface $uriContext;
protected readonly RouteContextData $routeContextData;
protected string $controllerName;
/**
* @throws SessionTimeout
@@ -70,7 +73,8 @@ abstract class SimpleControllerBase
$this->request = $simpleControllerHelper->getRequest();
$this->extensionChecker = $simpleControllerHelper->getExtensionChecker();
$this->uriContext = $simpleControllerHelper->getUriContext();
$this->controllerName = $this->getControllerName();
$this->routeContextData = $simpleControllerHelper->getRouteContextData();
$this->controllerName = $this->routeContextData->getController();
$this->config = $application->getConfig();
$this->configData = $this->config->getConfigData();
$this->eventDispatcher = $application->getEventDispatcher();