* [ADD] Test API module without using a real sysPass instance.

* [MOD] Improve module loading.
* [MOD] Improve backup file regex.
* [MOD] Minor code tweaks.

Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
Rubén D
2021-10-17 16:26:39 +02:00
parent 58249da565
commit ebe58282f6
66 changed files with 3076 additions and 2228 deletions

View File

@@ -66,7 +66,10 @@ final class ClientController extends ControllerBase
$clientData = $this->clientService->getById($id);
$this->eventDispatcher->notifyEvent('show.client', new Event($this));
$this->eventDispatcher->notifyEvent(
'show.client',
new Event($this)
);
$this->eventDispatcher->notifyEvent(
'show.client',
@@ -85,7 +88,10 @@ final class ClientController extends ControllerBase
$out = $this->fractal
->createData(
new Item($clientData, new ClientAdapter($this->configData)));
new Item(
$clientData,
new ClientAdapter($this->configData)
));
if ($customFields) {
$this->apiService->requireMasterPass();
@@ -117,6 +123,8 @@ final class ClientController extends ControllerBase
$id = $this->clientService->create($clientData);
$clientData->setId($id);
$this->eventDispatcher->notifyEvent(
'create.client',
new Event(
@@ -234,7 +242,10 @@ final class ClientController extends ControllerBase
$itemSearchData->setSeachString($this->apiService->getParamString('text'));
$itemSearchData->setLimitCount($this->apiService->getParamInt('count', false, self::SEARCH_COUNT_ITEMS));
$this->eventDispatcher->notifyEvent('search.client', new Event($this));
$this->eventDispatcher->notifyEvent(
'search.client',
new Event($this)
);
$this->returnResponse(
ApiResponse::makeSuccess(
@@ -249,9 +260,7 @@ final class ClientController extends ControllerBase
}
/**
* @throws DependencyException
* @throws NotFoundException
* @throws InvalidClassException
* @throws \SP\Core\Exceptions\InvalidClassException
*/
protected function initialize(): void
{