auto fixes + some impl.

This commit is contained in:
Dennis Eichhorn 2024-01-26 22:53:59 +00:00
parent e83bfffc2f
commit 8106743eec
44 changed files with 525 additions and 506 deletions

View File

@ -248,6 +248,11 @@
"type": "TINYINT(1)", "type": "TINYINT(1)",
"null": false "null": false
}, },
"contractmgmt_attr_type_internal": {
"name": "contractmgmt_attr_type_internal",
"type": "TINYINT(1)",
"null": false
},
"contractmgmt_attr_type_required": { "contractmgmt_attr_type_required": {
"description": "Every contract must have this attribute type if set to true.", "description": "Every contract must have this attribute type if set to true.",
"name": "contractmgmt_attr_type_required", "name": "contractmgmt_attr_type_required",

View File

@ -20,7 +20,6 @@ use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Module\InstallerAbstract; use phpOMS\Module\InstallerAbstract;
use phpOMS\Module\ModuleInfo; use phpOMS\Module\ModuleInfo;
use phpOMS\Uri\HttpUri;
/** /**
* Installer class. * Installer class.
@ -81,7 +80,7 @@ final class Installer extends InstallerAbstract
foreach ($types as $type) { foreach ($types as $type) {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('name', $type['name'] ?? ''); $request->setData('name', $type['name'] ?? '');
@ -109,7 +108,7 @@ final class Installer extends InstallerAbstract
} }
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', $l11n); $request->setData('title', $l11n);

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/contract/type.*$' => [ '^.*/contract/type(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\ApiContractTypeController:apiContractTypeCreate', 'dest' => '\Modules\ContractManagement\Controller\ApiContractTypeController:apiContractTypeCreate',
'verb' => RouteVerb::PUT, 'verb' => RouteVerb::PUT,
@ -60,7 +60,7 @@ return [
], ],
], ],
'^.*/contract/attribute.*$' => [ '^.*/contract/attribute(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\ApiAttributeController:apiContractAttributeCreate', 'dest' => '\Modules\ContractManagement\Controller\ApiAttributeController:apiContractAttributeCreate',
'verb' => RouteVerb::PUT, 'verb' => RouteVerb::PUT,

View File

@ -18,7 +18,7 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb; use phpOMS\Router\RouteVerb;
return [ return [
'^.*/contract/list.*$' => [ '^.*/contract/list(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractList', 'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -29,7 +29,7 @@ return [
], ],
], ],
], ],
'^.*/contract/single.*$' => [ '^.*/contract/view(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContract', 'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContract',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -40,7 +40,7 @@ return [
], ],
], ],
], ],
'^.*/contract/type/list.*$' => [ '^.*/contract/type/list(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractTypeList', 'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractTypeList',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,
@ -51,7 +51,7 @@ return [
], ],
], ],
], ],
'^.*/contract/type/profile.*$' => [ '^.*/contract/type/view(\?.*$|$)' => [
[ [
'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractType', 'dest' => '\Modules\ContractManagement\Controller\BackendController:viewContractType',
'verb' => RouteVerb::GET, 'verb' => RouteVerb::GET,

View File

@ -148,13 +148,20 @@ final class ApiAttributeController extends Controller
->where('id', $request->getDataInt('type') ?? 0) ->where('id', $request->getDataInt('type') ?? 0)
->execute(); ->execute();
if ($type->isInternal) {
$response->header->status = RequestStatusCode::R_403;
$this->createInvalidCreateResponse($request, $response, $val);
return;
}
$attrValue = $this->createAttributeValueFromRequest($request, $type); $attrValue = $this->createAttributeValueFromRequest($request, $type);
$this->createModel($request->header->account, $attrValue, ContractAttributeValueMapper::class, 'attr_value', $request->getOrigin()); $this->createModel($request->header->account, $attrValue, ContractAttributeValueMapper::class, 'attr_value', $request->getOrigin());
if ($attrValue->isDefault) { if ($attrValue->isDefault) {
$this->createModelRelation( $this->createModelRelation(
$request->header->account, $request->header->account,
(int) $request->getData('type'), $type->id,
$attrValue->id, $attrValue->id,
ContractAttributeTypeMapper::class, 'defaults', '', $request->getOrigin() ContractAttributeTypeMapper::class, 'defaults', '', $request->getOrigin()
); );

View File

@ -73,7 +73,10 @@ final class ApiContractTypeController extends Controller
private function createContractTypeFromRequest(RequestAbstract $request) : BaseStringL11nType private function createContractTypeFromRequest(RequestAbstract $request) : BaseStringL11nType
{ {
$contractType = new BaseStringL11nType(); $contractType = new BaseStringL11nType();
$contractType->setL11n($request->getDataString('title') ?? '', $request->getDataString('language') ?? ISO639x1Enum::_EN); $contractType->setL11n(
$request->getDataString('title') ?? '',
ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? ISO639x1Enum::_EN
);
$contractType->title = $request->getDataString('name') ?? ''; $contractType->title = $request->getDataString('name') ?? '';
return $contractType; return $contractType;
@ -137,12 +140,10 @@ final class ApiContractTypeController extends Controller
*/ */
private function createContractTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n private function createContractTypeL11nFromRequest(RequestAbstract $request) : BaseStringL11n
{ {
$contractTypeL11n = new BaseStringL11n(); $contractTypeL11n = new BaseStringL11n();
$contractTypeL11n->ref = $request->getDataInt('type') ?? 0; $contractTypeL11n->ref = $request->getDataInt('type') ?? 0;
$contractTypeL11n->setLanguage( $contractTypeL11n->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $request->header->l11n->language;
$request->getDataString('language') ?? $request->header->l11n->language $contractTypeL11n->content = $request->getDataString('title') ?? '';
);
$contractTypeL11n->content = $request->getDataString('title') ?? '';
return $contractTypeL11n; return $contractTypeL11n;
} }
@ -327,10 +328,8 @@ final class ApiContractTypeController extends Controller
*/ */
public function updateContractTypeL11nFromRequest(RequestAbstract $request, BaseStringL11n $new) : BaseStringL11n public function updateContractTypeL11nFromRequest(RequestAbstract $request, BaseStringL11n $new) : BaseStringL11n
{ {
$new->setLanguage( $new->language = ISO639x1Enum::tryFromValue($request->getDataString('language')) ?? $new->language;
$request->getDataString('language') ?? $new->language $new->content = $request->getDataString('title') ?? $new->content;
);
$new->content = $request->getDataString('title') ?? $new->content;
return $new; return $new;
} }

View File

@ -150,7 +150,7 @@ final class BackendController extends Controller
{ {
$view = new View($this->app->l11nManager, $request, $response); $view = new View($this->app->l11nManager, $request, $response);
$view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-single'); $view->setTemplate('/Modules/ContractManagement/Theme/Backend/contract-view');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response); $view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1007901001, $request, $response);
$contract = ContractMapper::get() $contract = ContractMapper::get()

View File

@ -37,10 +37,10 @@ final class ContractAttributeMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'contractmgmt_contract_attr_id' => ['name' => 'contractmgmt_contract_attr_id', 'type' => 'int', 'internal' => 'id'], 'contractmgmt_contract_attr_id' => ['name' => 'contractmgmt_contract_attr_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_attr_contract' => ['name' => 'contractmgmt_contract_attr_contract', 'type' => 'int', 'internal' => 'ref'], 'contractmgmt_contract_attr_contract' => ['name' => 'contractmgmt_contract_attr_contract', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_contract_attr_type' => ['name' => 'contractmgmt_contract_attr_type', 'type' => 'int', 'internal' => 'type'], 'contractmgmt_contract_attr_type' => ['name' => 'contractmgmt_contract_attr_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_attr_value' => ['name' => 'contractmgmt_contract_attr_value', 'type' => 'int', 'internal' => 'value'], 'contractmgmt_contract_attr_value' => ['name' => 'contractmgmt_contract_attr_value', 'type' => 'int', 'internal' => 'value'],
]; ];
/** /**

View File

@ -42,7 +42,8 @@ final class ContractAttributeTypeMapper extends DataMapperFactory
'contractmgmt_attr_type_datatype' => ['name' => 'contractmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], 'contractmgmt_attr_type_datatype' => ['name' => 'contractmgmt_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'],
'contractmgmt_attr_type_fields' => ['name' => 'contractmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], 'contractmgmt_attr_type_fields' => ['name' => 'contractmgmt_attr_type_fields', 'type' => 'int', 'internal' => 'fields'],
'contractmgmt_attr_type_custom' => ['name' => 'contractmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], 'contractmgmt_attr_type_custom' => ['name' => 'contractmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'],
'contractmgmt_attr_type_repeatable' => ['name' => 'contractmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'], 'contractmgmt_attr_type_repeatable' => ['name' => 'contractmgmt_attr_type_repeatable', 'type' => 'bool', 'internal' => 'repeatable'],
'contractmgmt_attr_type_internal' => ['name' => 'contractmgmt_attr_type_internal', 'type' => 'bool', 'internal' => 'isInternal'],
'contractmgmt_attr_type_pattern' => ['name' => 'contractmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], 'contractmgmt_attr_type_pattern' => ['name' => 'contractmgmt_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'],
'contractmgmt_attr_type_required' => ['name' => 'contractmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], 'contractmgmt_attr_type_required' => ['name' => 'contractmgmt_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'],
]; ];

View File

@ -37,10 +37,10 @@ final class ContractAttributeValueL11nMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'contractmgmt_attr_value_l11n_id' => ['name' => 'contractmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'], 'contractmgmt_attr_value_l11n_id' => ['name' => 'contractmgmt_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_l11n_title' => ['name' => 'contractmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], 'contractmgmt_attr_value_l11n_title' => ['name' => 'contractmgmt_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true],
'contractmgmt_attr_value_l11n_value' => ['name' => 'contractmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'], 'contractmgmt_attr_value_l11n_value' => ['name' => 'contractmgmt_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'],
'contractmgmt_attr_value_l11n_lang' => ['name' => 'contractmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'], 'contractmgmt_attr_value_l11n_lang' => ['name' => 'contractmgmt_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'],
]; ];
/** /**

View File

@ -37,15 +37,15 @@ final class ContractAttributeValueMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'contractmgmt_attr_value_id' => ['name' => 'contractmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'], 'contractmgmt_attr_value_id' => ['name' => 'contractmgmt_attr_value_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_attr_value_default' => ['name' => 'contractmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], 'contractmgmt_attr_value_default' => ['name' => 'contractmgmt_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'],
'contractmgmt_attr_value_valueStr' => ['name' => 'contractmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], 'contractmgmt_attr_value_valueStr' => ['name' => 'contractmgmt_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'],
'contractmgmt_attr_value_valueInt' => ['name' => 'contractmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], 'contractmgmt_attr_value_valueInt' => ['name' => 'contractmgmt_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'],
'contractmgmt_attr_value_valueDec' => ['name' => 'contractmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], 'contractmgmt_attr_value_valueDec' => ['name' => 'contractmgmt_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'],
'contractmgmt_attr_value_valueDat' => ['name' => 'contractmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], 'contractmgmt_attr_value_valueDat' => ['name' => 'contractmgmt_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'],
'contractmgmt_attr_value_unit' => ['name' => 'contractmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], 'contractmgmt_attr_value_unit' => ['name' => 'contractmgmt_attr_value_unit', 'type' => 'string', 'internal' => 'unit'],
'contractmgmt_attr_value_deptype' => ['name' => 'contractmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], 'contractmgmt_attr_value_deptype' => ['name' => 'contractmgmt_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'],
'contractmgmt_attr_value_depvalue' => ['name' => 'contractmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], 'contractmgmt_attr_value_depvalue' => ['name' => 'contractmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'],
]; ];
/** /**

View File

@ -42,24 +42,24 @@ final class ContractMapper extends DataMapperFactory
* @since 1.0.0 * @since 1.0.0
*/ */
public const COLUMNS = [ public const COLUMNS = [
'contractmgmt_contract_id' => ['name' => 'contractmgmt_contract_id', 'type' => 'int', 'internal' => 'id'], 'contractmgmt_contract_id' => ['name' => 'contractmgmt_contract_id', 'type' => 'int', 'internal' => 'id'],
'contractmgmt_contract_parent' => ['name' => 'contractmgmt_contract_parent', 'type' => 'int', 'internal' => 'parent'], 'contractmgmt_contract_parent' => ['name' => 'contractmgmt_contract_parent', 'type' => 'int', 'internal' => 'parent'],
'contractmgmt_contract_template' => ['name' => 'contractmgmt_contract_template', 'type' => 'bool', 'internal' => 'isTemplate'], 'contractmgmt_contract_template' => ['name' => 'contractmgmt_contract_template', 'type' => 'bool', 'internal' => 'isTemplate'],
'contractmgmt_contract_title' => ['name' => 'contractmgmt_contract_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true], 'contractmgmt_contract_title' => ['name' => 'contractmgmt_contract_title', 'type' => 'string', 'internal' => 'title', 'autocomplete' => true],
'contractmgmt_contract_description' => ['name' => 'contractmgmt_contract_description', 'type' => 'string', 'internal' => 'description'], 'contractmgmt_contract_description' => ['name' => 'contractmgmt_contract_description', 'type' => 'string', 'internal' => 'description'],
'contractmgmt_contract_account' => ['name' => 'contractmgmt_contract_account', 'type' => 'int', 'internal' => 'account'], 'contractmgmt_contract_account' => ['name' => 'contractmgmt_contract_account', 'type' => 'int', 'internal' => 'account'],
'contractmgmt_contract_costs' => ['name' => 'contractmgmt_contract_costs', 'type' => 'Serializable', 'internal' => 'costs'], 'contractmgmt_contract_costs' => ['name' => 'contractmgmt_contract_costs', 'type' => 'Serializable', 'internal' => 'costs'],
'contractmgmt_contract_renewal' => ['name' => 'contractmgmt_contract_renewal', 'type' => 'int', 'internal' => 'renewal'], 'contractmgmt_contract_renewal' => ['name' => 'contractmgmt_contract_renewal', 'type' => 'int', 'internal' => 'renewal'],
'contractmgmt_contract_autorenewal' => ['name' => 'contractmgmt_contract_autorenewal', 'type' => 'bool', 'internal' => 'autoRenewal'], 'contractmgmt_contract_autorenewal' => ['name' => 'contractmgmt_contract_autorenewal', 'type' => 'bool', 'internal' => 'autoRenewal'],
'contractmgmt_contract_duration' => ['name' => 'contractmgmt_contract_duration', 'type' => 'int', 'internal' => 'duration'], 'contractmgmt_contract_duration' => ['name' => 'contractmgmt_contract_duration', 'type' => 'int', 'internal' => 'duration'],
'contractmgmt_contract_warning' => ['name' => 'contractmgmt_contract_warning', 'type' => 'int', 'internal' => 'warning'], 'contractmgmt_contract_warning' => ['name' => 'contractmgmt_contract_warning', 'type' => 'int', 'internal' => 'warning'],
'contractmgmt_contract_startoriginal' => ['name' => 'contractmgmt_contract_startoriginal', 'type' => 'DateTime', 'internal' => 'originalStart'], 'contractmgmt_contract_startoriginal' => ['name' => 'contractmgmt_contract_startoriginal', 'type' => 'DateTime', 'internal' => 'originalStart'],
'contractmgmt_contract_start' => ['name' => 'contractmgmt_contract_start', 'type' => 'DateTime', 'internal' => 'start'], 'contractmgmt_contract_start' => ['name' => 'contractmgmt_contract_start', 'type' => 'DateTime', 'internal' => 'start'],
'contractmgmt_contract_end' => ['name' => 'contractmgmt_contract_end', 'type' => 'DateTime', 'internal' => 'end'], 'contractmgmt_contract_end' => ['name' => 'contractmgmt_contract_end', 'type' => 'DateTime', 'internal' => 'end'],
'contractmgmt_contract_responsible' => ['name' => 'contractmgmt_contract_responsible', 'type' => 'int', 'internal' => 'responsible'], 'contractmgmt_contract_responsible' => ['name' => 'contractmgmt_contract_responsible', 'type' => 'int', 'internal' => 'responsible'],
'contractmgmt_contract_unit' => ['name' => 'contractmgmt_contract_unit', 'type' => 'int', 'internal' => 'unit'], 'contractmgmt_contract_unit' => ['name' => 'contractmgmt_contract_unit', 'type' => 'int', 'internal' => 'unit'],
'contractmgmt_contract_type' => ['name' => 'contractmgmt_contract_type', 'type' => 'int', 'internal' => 'type'], 'contractmgmt_contract_type' => ['name' => 'contractmgmt_contract_type', 'type' => 'int', 'internal' => 'type'],
'contractmgmt_contract_created_at' => ['name' => 'contractmgmt_contract_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'], 'contractmgmt_contract_created_at' => ['name' => 'contractmgmt_contract_created_at', 'type' => 'DateTimeImmutable', 'internal' => 'createdAt'],
]; ];
/** /**

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'اتفافية', 'Contract' => 'اتفافية',
'Contracts' => 'انكماش', 'Contracts' => 'انكماش',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'عنوان', 'Title' => 'عنوان',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Smlouva', 'Contract' => 'Smlouva',
'Contracts' => 'Smlouvy', 'Contracts' => 'Smlouvy',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Titul', 'Title' => 'Titul',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Kontrakt', 'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter', 'Contracts' => 'Kontrakter',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Titel', 'Title' => 'Titel',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => 'Account', 'Account' => 'Account',
'AutoRenewal' => 'Automatische Verlängerung', 'AutoRenewal' => 'Automatische Verlängerung',
'Contract' => 'Vertrag', 'Contract' => 'Vertrag',
'Contracts' => 'Verträge', 'Contracts' => 'Verträge',
'Costs' => 'Kosten', 'Costs' => 'Kosten',
'Description' => 'Beschreibung', 'Description' => 'Beschreibung',
'End' => 'Ende', 'End' => 'Ende',
'Files' => 'Dateien', 'Files' => 'Dateien',
'Name' => 'Name', 'Name' => 'Name',
'Overview' => 'Übersicht', 'Overview' => 'Übersicht',
'Parties' => 'Parteien', 'Parties' => 'Parteien',
'Start' => 'Start', 'Start' => 'Start',
'Termination' => 'Beendigung', 'Termination' => 'Beendigung',
'Title' => 'Titel', 'Title' => 'Titel',
'Type' => 'Typ', 'Type' => 'Typ',
'Unit' => 'Unit', 'Unit' => 'Unit',
'With' => 'Mit', 'With' => 'Mit',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Σύμβαση', 'Contract' => 'Σύμβαση',
'Contracts' => 'Συμβάσεις', 'Contracts' => 'Συμβάσεις',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Τίτλος', 'Title' => 'Τίτλος',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => 'Account', 'Account' => 'Account',
'AutoRenewal' => 'Auto Renewal', 'AutoRenewal' => 'Auto Renewal',
'Contract' => 'Contract', 'Contract' => 'Contract',
'Contracts' => 'Contracts', 'Contracts' => 'Contracts',
'Costs' => 'Costs', 'Costs' => 'Costs',
'Description' => 'Description', 'Description' => 'Description',
'End' => 'End', 'End' => 'End',
'Files' => 'Files', 'Files' => 'Files',
'Name' => '', 'Name' => '',
'Overview' => 'Overview', 'Overview' => 'Overview',
'Parties' => 'Parties', 'Parties' => 'Parties',
'Start' => 'Start', 'Start' => 'Start',
'Termination' => 'Termination', 'Termination' => 'Termination',
'Title' => 'Title', 'Title' => 'Title',
'Type' => 'Type', 'Type' => 'Type',
'Unit' => 'Unit', 'Unit' => 'Unit',
'With' => 'With', 'With' => 'With',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Contrato', 'Contract' => 'Contrato',
'Contracts' => 'Contrato', 'Contracts' => 'Contrato',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Título', 'Title' => 'Título',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Sopimus', 'Contract' => 'Sopimus',
'Contracts' => 'Sopimukset', 'Contracts' => 'Sopimukset',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Otsikko', 'Title' => 'Otsikko',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Contracter', 'Contract' => 'Contracter',
'Contracts' => 'Contrats', 'Contracts' => 'Contrats',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Titre', 'Title' => 'Titre',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Szerződés', 'Contract' => 'Szerződés',
'Contracts' => 'Szerződések', 'Contracts' => 'Szerződések',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Cím', 'Title' => 'Cím',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Contrarre', 'Contract' => 'Contrarre',
'Contracts' => 'Contratti', 'Contracts' => 'Contratti',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Titolo', 'Title' => 'Titolo',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => '契約', 'Contract' => '契約',
'Contracts' => '契約', 'Contracts' => '契約',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'タイトル', 'Title' => 'タイトル',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => '계약', 'Contract' => '계약',
'Contracts' => '계약서', 'Contracts' => '계약서',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => '제목', 'Title' => '제목',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Kontrakt', 'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakter', 'Contracts' => 'Kontrakter',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Tittel', 'Title' => 'Tittel',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Kontrakt', 'Contract' => 'Kontrakt',
'Contracts' => 'Kontrakty', 'Contracts' => 'Kontrakty',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Tytuł', 'Title' => 'Tytuł',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Contrato', 'Contract' => 'Contrato',
'Contracts' => 'Contratos', 'Contracts' => 'Contratos',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Título', 'Title' => 'Título',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Договор', 'Contract' => 'Договор',
'Contracts' => 'Контракты', 'Contracts' => 'Контракты',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Заголовок', 'Title' => 'Заголовок',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Avtal', 'Contract' => 'Avtal',
'Contracts' => 'Kontrakt', 'Contracts' => 'Kontrakt',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Titel', 'Title' => 'Titel',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'สัญญา', 'Contract' => 'สัญญา',
'Contracts' => 'สัญญา', 'Contracts' => 'สัญญา',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'ชื่อ', 'Title' => 'ชื่อ',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Sözleşme', 'Contract' => 'Sözleşme',
'Contracts' => 'Sözleşme', 'Contracts' => 'Sözleşme',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Başlık', 'Title' => 'Başlık',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => 'Договір', 'Contract' => 'Договір',
'Contracts' => 'Контракти', 'Contracts' => 'Контракти',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => 'Заголовок', 'Title' => 'Заголовок',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -13,21 +13,21 @@
declare(strict_types=1); declare(strict_types=1);
return ['ContractManagement' => [ return ['ContractManagement' => [
'Account' => '', 'Account' => '',
'AutoRenewal' => '', 'AutoRenewal' => '',
'Contract' => '合同', 'Contract' => '合同',
'Contracts' => '合同', 'Contracts' => '合同',
'Costs' => '', 'Costs' => '',
'Description' => '', 'Description' => '',
'End' => '', 'End' => '',
'Files' => '', 'Files' => '',
'Name' => '', 'Name' => '',
'Overview' => '', 'Overview' => '',
'Parties' => '', 'Parties' => '',
'Start' => '', 'Start' => '',
'Termination' => '', 'Termination' => '',
'Title' => '标题', 'Title' => '标题',
'Type' => '', 'Type' => '',
'Unit' => '', 'Unit' => '',
'With' => '', 'With' => '',
]]; ]];

View File

@ -73,7 +73,7 @@ echo $this->data['nav']->render(); ?>
</label> </label>
<tbody> <tbody>
<?php foreach ($contracts as $key => $value) : <?php foreach ($contracts as $key => $value) :
$url = UriFactory::build('{/base}/contract/single?{?}&id=' . $value->id); $url = UriFactory::build('{/base}/contract/view?{?}&id=' . $value->id);
$type = 'ok'; $type = 'ok';
if (($value->end->getTimestamp() < $now->getTimestamp() && $value->end->getTimestamp() + 7776000 > $now->getTimestamp()) if (($value->end->getTimestamp() < $now->getTimestamp() && $value->end->getTimestamp() + 7776000 > $now->getTimestamp())
@ -88,7 +88,7 @@ echo $this->data['nav']->render(); ?>
?> ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a> <td data-label="<?= $this->getHtml('Title'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->title); ?></a>
<td data-label="<?= $this->getHtml('Account'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/single?{?}&for=' . $value->account->id); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a> <td data-label="<?= $this->getHtml('Account'); ?>"><a class="content" href="<?= UriFactory::build('{/base}/profile/view?{?}&for=' . $value->account->id); ?>"><?= $this->printHtml($value->account->name1); ?> <?= $this->printHtml($value->account->name2); ?></a>
<td data-label="<?= $this->getHtml('End'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $type; ?>"><?= $value->end !== null ? $value->end->format('Y-m-d') : ''; ?></span></a> <td data-label="<?= $this->getHtml('End'); ?>"><a href="<?= $url; ?>"><span class="tag <?= $type; ?>"><?= $value->end !== null ? $value->end->format('Y-m-d') : ''; ?></span></a>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>

View File

@ -55,7 +55,7 @@ echo $this->data['nav']->render(); ?>
<?php <?php
$count = 0; $count = 0;
foreach ($types as $key => $value) : ++$count; foreach ($types as $key => $value) : ++$count;
$url = UriFactory::build('{/base}/contract/type/profile?{?}&id=' . $value->id); $url = UriFactory::build('{/base}/contract/type/view?{?}&id=' . $value->id);
?> ?>
<tr data-href="<?= $url; ?>"> <tr data-href="<?= $url; ?>">
<td><a href="<?= $url; ?>"><?= $value->id; ?></a> <td><a href="<?= $url; ?>"><?= $value->id; ?></a>

View File

@ -75,8 +75,8 @@ final class Autoloader
*/ */
public static function defaultAutoloader(string $class) : void public static function defaultAutoloader(string $class) : void
{ {
$class = \ltrim($class, '\\'); $class = \ltrim($class, '\\');
$class = \strtr($class, '_\\', '//'); $class = \strtr($class, '_\\', '//');
if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) { if (\stripos($class, 'Web/Backend') !== false || \stripos($class, 'Web/Api') !== false) {
$class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class); $class = \is_dir(__DIR__ . '/Web') ? $class : \str_replace('Web/', 'MainRepository/Web/', $class);

View File

@ -1,4 +1,15 @@
<?php <?php
/**
* Jingga
*
* PHP Version 8.1
*
* @package Modules\ContractManagement\tests
* @copyright Dennis Eichhorn
* @license OMS License 2.0
* @version 1.0.0
* @link https://jingga.app
*/
declare(strict_types=1); declare(strict_types=1);
\ini_set('memory_limit', '2048M'); \ini_set('memory_limit', '2048M');
@ -67,10 +78,10 @@ $GLOBALS['is_github'] = $IS_GITHUB;
$tmp = FileLogger::getInstance(__DIR__ . '/../Logs'); $tmp = FileLogger::getInstance(__DIR__ . '/../Logs');
$CONFIG = [ $CONFIG = [
'db' => [ 'db' => [
'core' => [ 'core' => [
'masters' => [ 'masters' => [
'admin' => [ 'admin' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -80,7 +91,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -90,7 +101,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -100,7 +111,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -110,7 +121,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -120,7 +131,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'mysql', /* db type */ 'db' => 'mysql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '3306', /* db host port */ 'port' => '3306', /* db host port */
@ -132,7 +143,7 @@ $CONFIG = [
], ],
], ],
'postgresql' => [ 'postgresql' => [
'admin' => [ 'admin' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -142,7 +153,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -152,7 +163,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -162,7 +173,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -172,7 +183,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -182,7 +193,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'pgsql', /* db type */ 'db' => 'pgsql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '5432', /* db host port */ 'port' => '5432', /* db host port */
@ -194,37 +205,37 @@ $CONFIG = [
], ],
], ],
'sqlite' => [ 'sqlite' => [
'admin' => [ 'admin' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'sqlite', /* db type */ 'db' => 'sqlite', /* db type */
'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */ 'database' => __DIR__ . '/../Karaka/phpOMS/Localization/Defaults/localization.sqlite', /* db name */
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
@ -232,7 +243,7 @@ $CONFIG = [
], ],
], ],
'mssql' => [ 'mssql' => [
'admin' => [ 'admin' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -242,7 +253,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'insert' => [ 'insert' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -252,7 +263,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'select' => [ 'select' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -262,7 +273,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'update' => [ 'update' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -272,7 +283,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'delete' => [ 'delete' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -282,7 +293,7 @@ $CONFIG = [
'weight' => 1000, /* db table prefix */ 'weight' => 1000, /* db table prefix */
'datetimeformat' => 'Y-m-d H:i:s', 'datetimeformat' => 'Y-m-d H:i:s',
], ],
'schema' => [ 'schema' => [
'db' => 'mssql', /* db type */ 'db' => 'mssql', /* db type */
'host' => '127.0.0.1', /* db host address */ 'host' => '127.0.0.1', /* db host address */
'port' => '1433', /* db host port */ 'port' => '1433', /* db host port */
@ -322,16 +333,16 @@ $CONFIG = [
'password' => '123456', 'password' => '123456',
], ],
], ],
'log' => [ 'log' => [
'file' => [ 'file' => [
'path' => __DIR__ . '/Logs', 'path' => __DIR__ . '/Logs',
], ],
], ],
'page' => [ 'page' => [
'root' => '/', 'root' => '/',
'https' => false, 'https' => false,
], ],
'app' => [ 'app' => [
'path' => __DIR__, 'path' => __DIR__,
'default' => [ 'default' => [
'app' => 'Backend', 'app' => 'Backend',
@ -350,7 +361,7 @@ $CONFIG = [
], ],
], ],
], ],
'socket' => [ 'socket' => [
'master' => [ 'master' => [
'host' => '127.0.0.1', 'host' => '127.0.0.1',
'limit' => 300, 'limit' => 300,
@ -360,7 +371,7 @@ $CONFIG = [
'language' => [ 'language' => [
'en', 'en',
], ],
'apis' => [ 'apis' => [
], ],
]; ];

View File

@ -19,7 +19,6 @@ use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerAttributeTrait trait ApiControllerAttributeTrait
{ {
@ -30,7 +29,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeCreate() : void public function testApiContractAttributeTypeCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', 'EN:1'); $request->setData('title', 'EN:1');
@ -48,7 +47,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeL11nCreate() : void public function testApiContractAttributeTypeL11nCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', 'DE:2'); $request->setData('title', 'DE:2');
@ -66,7 +65,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueIntCreate() : void public function testApiContractAttributeValueIntCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('default', '1'); $request->setData('default', '1');
@ -86,7 +85,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueStrCreate() : void public function testApiContractAttributeValueStrCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('value', '1'); $request->setData('value', '1');
@ -105,7 +104,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueFloatCreate() : void public function testApiContractAttributeValueFloatCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('value', '1.1'); $request->setData('value', '1.1');
@ -124,7 +123,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueDatCreate() : void public function testApiContractAttributeValueDatCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('value', '2020-08-02'); $request->setData('value', '2020-08-02');
@ -143,7 +142,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeCreate() : void public function testApiContractAttributeCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('ref', '1'); $request->setData('ref', '1');
@ -161,7 +160,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeValueCreateInvalidData() : void public function testApiContractAttributeValueCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');
@ -177,7 +176,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeCreateInvalidData() : void public function testApiContractAttributeTypeCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');
@ -193,7 +192,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeTypeL11nCreateInvalidData() : void public function testApiContractAttributeTypeL11nCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');
@ -209,7 +208,7 @@ trait ApiControllerAttributeTrait
public function testApiContractAttributeCreateInvalidData() : void public function testApiContractAttributeCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');

View File

@ -17,7 +17,6 @@ namespace Modules\ContractManagement\tests\Controller\Api;
use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
use phpOMS\Utils\TestUtils; use phpOMS\Utils\TestUtils;
trait ApiControllerContractTrait trait ApiControllerContractTrait
@ -29,7 +28,7 @@ trait ApiControllerContractTrait
public function testApiContractCreate() : void public function testApiContractCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', 'Title'); $request->setData('title', 'Title');
@ -49,7 +48,7 @@ trait ApiControllerContractTrait
public function testApiContractCreateInvalidData() : void public function testApiContractCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');
@ -65,7 +64,7 @@ trait ApiControllerContractTrait
public function testApiContractDocCreate() : void public function testApiContractDocCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
if (!\is_file(__DIR__ . '/test_tmp.pdf')) { if (!\is_file(__DIR__ . '/test_tmp.pdf')) {
\copy(__DIR__ . '/test.pdf', __DIR__ . '/test_tmp.pdf'); \copy(__DIR__ . '/test.pdf', __DIR__ . '/test_tmp.pdf');
@ -96,7 +95,7 @@ trait ApiControllerContractTrait
public function testApiContractDocCreateInvalidData() : void public function testApiContractDocCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');

View File

@ -18,7 +18,6 @@ use phpOMS\Localization\ISO639x1Enum;
use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpRequest;
use phpOMS\Message\Http\HttpResponse; use phpOMS\Message\Http\HttpResponse;
use phpOMS\Message\Http\RequestStatusCode; use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Uri\HttpUri;
trait ApiControllerContractTypeTrait trait ApiControllerContractTypeTrait
{ {
@ -29,7 +28,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeCreate() : void public function testApiContractTypeCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', 'Test'); $request->setData('title', 'Test');
@ -46,7 +45,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeCreateInvalidData() : void public function testApiContractTypeCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');
@ -62,7 +61,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeL11nCreate() : void public function testApiContractTypeL11nCreate() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('title', 'Test'); $request->setData('title', 'Test');
@ -80,7 +79,7 @@ trait ApiControllerContractTypeTrait
public function testApiContractTypeL11nCreateInvalidData() : void public function testApiContractTypeL11nCreateInvalidData() : void
{ {
$response = new HttpResponse(); $response = new HttpResponse();
$request = new HttpRequest(new HttpUri('')); $request = new HttpRequest();
$request->header->account = 1; $request->header->account = 1;
$request->setData('invalid', '1'); $request->setData('invalid', '1');

View File

@ -60,13 +60,13 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase
protected string $appName = 'Api'; protected string $appName = 'Api';
}; };
$this->app->dbPool = $GLOBALS['dbpool']; $this->app->dbPool = $GLOBALS['dbpool'];
$this->app->unitId = 1; $this->app->unitId = 1;
$this->app->accountManager = new AccountManager($GLOBALS['session']); $this->app->accountManager = new AccountManager($GLOBALS['session']);
$this->app->appSettings = new CoreSettings(); $this->app->appSettings = new CoreSettings();
$this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/'); $this->app->moduleManager = new ModuleManager($this->app, __DIR__ . '/../../../../Modules/');
$this->app->dispatcher = new Dispatcher($this->app); $this->app->dispatcher = new Dispatcher($this->app);
$this->app->eventManager = new EventManager($this->app->dispatcher); $this->app->eventManager = new EventManager($this->app->dispatcher);
$this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php'); $this->app->eventManager->importFromFile(__DIR__ . '/../../../../Web/Api/Hooks.php');
$this->app->sessionManager = new HttpSession(36000); $this->app->sessionManager = new HttpSession(36000);
$this->app->l11nManager = new L11nManager(); $this->app->l11nManager = new L11nManager();

View File

@ -57,16 +57,16 @@ final class ContractTest extends \PHPUnit\Framework\TestCase
self::assertEquals( self::assertEquals(
[ [
'id' => 0, 'id' => 0,
'title' => 'Title', 'title' => 'Title',
'description' => 'Description', 'description' => 'Description',
'start' => null, 'start' => null,
'end' => null, 'end' => null,
'duration' => 123, 'duration' => 123,
'warning' => 2, 'warning' => 2,
'responsible' => null, 'responsible' => null,
'costs' => null, 'costs' => null,
'type' => null, 'type' => null,
], ],
$serialized $serialized
); );