From 0db5d7e2a51721b2c1bab98593322ddbb69a0fd9 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Fri, 29 Sep 2023 02:38:01 +0000 Subject: [PATCH] fix tests --- Models/Attribute/ContractAttributeMapper.php | 4 +-- .../ContractAttributeTypeL11nMapper.php | 12 ++++----- .../Attribute/ContractAttributeTypeMapper.php | 22 ++++++++-------- .../ContractAttributeValueL11nMapper.php | 12 ++++----- .../ContractAttributeValueMapper.php | 26 +++++++++---------- .../Api/ApiControllerAttributeTrait.php | 2 +- tests/Controller/ApiControllerTest.php | 2 +- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/Models/Attribute/ContractAttributeMapper.php b/Models/Attribute/ContractAttributeMapper.php index 9b00445..92dae95 100644 --- a/Models/Attribute/ContractAttributeMapper.php +++ b/Models/Attribute/ContractAttributeMapper.php @@ -52,11 +52,11 @@ final class ContractAttributeMapper extends DataMapperFactory public const OWNS_ONE = [ 'type' => [ 'mapper' => ContractAttributeTypeMapper::class, - 'external' => 'contractmgmt_contract_attr_type', + 'external' => 'contractmgmt_attr_type', ], 'value' => [ 'mapper' => ContractAttributeValueMapper::class, - 'external' => 'contractmgmt_contract_attr_value', + 'external' => 'contractmgmt_attr_value', ], ]; diff --git a/Models/Attribute/ContractAttributeTypeL11nMapper.php b/Models/Attribute/ContractAttributeTypeL11nMapper.php index f1d8b77..e43d6c8 100644 --- a/Models/Attribute/ContractAttributeTypeL11nMapper.php +++ b/Models/Attribute/ContractAttributeTypeL11nMapper.php @@ -37,10 +37,10 @@ final class ContractAttributeTypeL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'contractmgmt_contract_attr_type_l11n_id' => ['name' => 'contractmgmt_contract_attr_type_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'contractmgmt_contract_attr_type_l11n_title' => ['name' => 'contractmgmt_contract_attr_type_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], - 'contractmgmt_contract_attr_type_l11n_type' => ['name' => 'contractmgmt_contract_attr_type_l11n_type', 'type' => 'int', 'internal' => 'ref'], - 'contractmgmt_contract_attr_type_l11n_lang' => ['name' => 'contractmgmt_contract_attr_type_l11n_lang', 'type' => 'string', 'internal' => 'language'], + 'contractmgmt_attr_type_l11n_id' => ['name' => 'contractmgmt_attr_type_l11n_id', 'type' => 'int', 'internal' => 'id'], + 'contractmgmt_attr_type_l11n_title' => ['name' => 'contractmgmt_attr_type_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], + 'contractmgmt_attr_type_l11n_type' => ['name' => 'contractmgmt_attr_type_l11n_type', 'type' => 'int', 'internal' => 'ref'], + 'contractmgmt_attr_type_l11n_lang' => ['name' => 'contractmgmt_attr_type_l11n_lang', 'type' => 'string', 'internal' => 'language'], ]; /** @@ -49,7 +49,7 @@ final class ContractAttributeTypeL11nMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const TABLE = 'contractmgmt_contract_attr_type_l11n'; + public const TABLE = 'contractmgmt_attr_type_l11n'; /** * Primary field name. @@ -57,7 +57,7 @@ final class ContractAttributeTypeL11nMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const PRIMARYFIELD = 'contractmgmt_contract_attr_type_l11n_id'; + public const PRIMARYFIELD = 'contractmgmt_attr_type_l11n_id'; /** * Model to use by the mapper. diff --git a/Models/Attribute/ContractAttributeTypeMapper.php b/Models/Attribute/ContractAttributeTypeMapper.php index 3b3e678..7e21c76 100644 --- a/Models/Attribute/ContractAttributeTypeMapper.php +++ b/Models/Attribute/ContractAttributeTypeMapper.php @@ -37,13 +37,13 @@ final class ContractAttributeTypeMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'contractmgmt_contract_attr_type_id' => ['name' => 'contractmgmt_contract_attr_type_id', 'type' => 'int', 'internal' => 'id'], - 'contractmgmt_contract_attr_type_name' => ['name' => 'contractmgmt_contract_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], - 'contractmgmt_contract_attr_type_datatype' => ['name' => 'contractmgmt_contract_attr_type_datatype', 'type' => 'int', 'internal' => 'datatype'], - 'contractmgmt_contract_attr_type_fields' => ['name' => 'contractmgmt_contract_attr_type_fields', 'type' => 'int', 'internal' => 'fields'], - 'contractmgmt_contract_attr_type_custom' => ['name' => 'contractmgmt_contract_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], - 'contractmgmt_contract_attr_type_pattern' => ['name' => 'contractmgmt_contract_attr_type_pattern', 'type' => 'string', 'internal' => 'validationPattern'], - 'contractmgmt_contract_attr_type_required' => ['name' => 'contractmgmt_contract_attr_type_required', 'type' => 'bool', 'internal' => 'isRequired'], + 'contractmgmt_attr_type_id' => ['name' => 'contractmgmt_attr_type_id', 'type' => 'int', 'internal' => 'id'], + 'contractmgmt_attr_type_name' => ['name' => 'contractmgmt_attr_type_name', 'type' => 'string', 'internal' => 'name', 'autocomplete' => true], + '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_custom' => ['name' => 'contractmgmt_attr_type_custom', 'type' => 'bool', 'internal' => 'custom'], + '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'], ]; /** @@ -55,8 +55,8 @@ final class ContractAttributeTypeMapper extends DataMapperFactory public const HAS_MANY = [ 'l11n' => [ 'mapper' => ContractAttributeTypeL11nMapper::class, - 'table' => 'contractmgmt_contract_attr_type_l11n', - 'self' => 'contractmgmt_contract_attr_type_l11n_type', + 'table' => 'contractmgmt_attr_type_l11n', + 'self' => 'contractmgmt_attr_type_l11n_type', 'column' => 'content', 'external' => null, ], @@ -82,7 +82,7 @@ final class ContractAttributeTypeMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const TABLE = 'contractmgmt_contract_attr_type'; + public const TABLE = 'contractmgmt_attr_type'; /** * Primary field name. @@ -90,5 +90,5 @@ final class ContractAttributeTypeMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const PRIMARYFIELD = 'contractmgmt_contract_attr_type_id'; + public const PRIMARYFIELD = 'contractmgmt_attr_type_id'; } diff --git a/Models/Attribute/ContractAttributeValueL11nMapper.php b/Models/Attribute/ContractAttributeValueL11nMapper.php index 409350d..3fa0660 100644 --- a/Models/Attribute/ContractAttributeValueL11nMapper.php +++ b/Models/Attribute/ContractAttributeValueL11nMapper.php @@ -37,10 +37,10 @@ final class ContractAttributeValueL11nMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'contractmgmt_contract_attr_value_l11n_id' => ['name' => 'contractmgmt_contract_attr_value_l11n_id', 'type' => 'int', 'internal' => 'id'], - 'contractmgmt_contract_attr_value_l11n_title' => ['name' => 'contractmgmt_contract_attr_value_l11n_title', 'type' => 'string', 'internal' => 'content', 'autocomplete' => true], - 'contractmgmt_contract_attr_value_l11n_value' => ['name' => 'contractmgmt_contract_attr_value_l11n_value', 'type' => 'int', 'internal' => 'ref'], - 'contractmgmt_contract_attr_value_l11n_lang' => ['name' => 'contractmgmt_contract_attr_value_l11n_lang', 'type' => 'string', 'internal' => 'language'], + '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_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'], ]; /** @@ -49,7 +49,7 @@ final class ContractAttributeValueL11nMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const TABLE = 'contractmgmt_contract_attr_value_l11n'; + public const TABLE = 'contractmgmt_attr_value_l11n'; /** * Primary field name. @@ -57,7 +57,7 @@ final class ContractAttributeValueL11nMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const PRIMARYFIELD = 'contractmgmt_contract_attr_value_l11n_id'; + public const PRIMARYFIELD = 'contractmgmt_attr_value_l11n_id'; /** * Model to use by the mapper. diff --git a/Models/Attribute/ContractAttributeValueMapper.php b/Models/Attribute/ContractAttributeValueMapper.php index 3ab204b..930e870 100644 --- a/Models/Attribute/ContractAttributeValueMapper.php +++ b/Models/Attribute/ContractAttributeValueMapper.php @@ -37,15 +37,15 @@ final class ContractAttributeValueMapper extends DataMapperFactory * @since 1.0.0 */ public const COLUMNS = [ - 'contractmgmt_contract_attr_value_id' => ['name' => 'contractmgmt_contract_attr_value_id', 'type' => 'int', 'internal' => 'id'], - 'contractmgmt_contract_attr_value_default' => ['name' => 'contractmgmt_contract_attr_value_default', 'type' => 'bool', 'internal' => 'isDefault'], - 'contractmgmt_contract_attr_value_valueStr' => ['name' => 'contractmgmt_contract_attr_value_valueStr', 'type' => 'string', 'internal' => 'valueStr'], - 'contractmgmt_contract_attr_value_valueInt' => ['name' => 'contractmgmt_contract_attr_value_valueInt', 'type' => 'int', 'internal' => 'valueInt'], - 'contractmgmt_contract_attr_value_valueDec' => ['name' => 'contractmgmt_contract_attr_value_valueDec', 'type' => 'float', 'internal' => 'valueDec'], - 'contractmgmt_contract_attr_value_valueDat' => ['name' => 'contractmgmt_contract_attr_value_valueDat', 'type' => 'DateTime', 'internal' => 'valueDat'], - 'contractmgmt_contract_attr_value_unit' => ['name' => 'contractmgmt_contract_attr_value_unit', 'type' => 'string', 'internal' => 'unit'], - 'contractmgmt_contract_attr_value_deptype' => ['name' => 'contractmgmt_contract_attr_value_deptype', 'type' => 'int', 'internal' => 'dependingAttributeType'], - 'contractmgmt_contract_attr_value_depvalue' => ['name' => 'contractmgmt_contract_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], + '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_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_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_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_depvalue' => ['name' => 'contractmgmt_attr_value_depvalue', 'type' => 'int', 'internal' => 'dependingAttributeValue'], ]; /** @@ -57,8 +57,8 @@ final class ContractAttributeValueMapper extends DataMapperFactory public const HAS_MANY = [ 'l11n' => [ 'mapper' => ContractAttributeValueL11nMapper::class, - 'table' => 'contractmgmt_contract_attr_value_l11n', - 'self' => 'contractmgmt_contract_attr_value_l11n_value', + 'table' => 'contractmgmt_attr_value_l11n', + 'self' => 'contractmgmt_attr_value_l11n_value', 'external' => null, ], ]; @@ -77,7 +77,7 @@ final class ContractAttributeValueMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const TABLE = 'contractmgmt_contract_attr_value'; + public const TABLE = 'contractmgmt_attr_value'; /** * Primary field name. @@ -85,5 +85,5 @@ final class ContractAttributeValueMapper extends DataMapperFactory * @var string * @since 1.0.0 */ - public const PRIMARYFIELD = 'contractmgmt_contract_attr_value_id'; + public const PRIMARYFIELD = 'contractmgmt_attr_value_id'; } diff --git a/tests/Controller/Api/ApiControllerAttributeTrait.php b/tests/Controller/Api/ApiControllerAttributeTrait.php index 8a82787..99fecbb 100644 --- a/tests/Controller/Api/ApiControllerAttributeTrait.php +++ b/tests/Controller/Api/ApiControllerAttributeTrait.php @@ -146,7 +146,7 @@ trait ApiControllerAttributeTrait $request = new HttpRequest(new HttpUri('')); $request->header->account = 1; - $request->setData('client', '1'); + $request->setData('ref', '1'); $request->setData('value', '1'); $request->setData('type', '1'); diff --git a/tests/Controller/ApiControllerTest.php b/tests/Controller/ApiControllerTest.php index 696b8b0..82df497 100755 --- a/tests/Controller/ApiControllerTest.php +++ b/tests/Controller/ApiControllerTest.php @@ -99,7 +99,7 @@ final class ApiControllerTest extends \PHPUnit\Framework\TestCase TestUtils::setMember($this->typeModule, 'app', $this->app); } - use ApiControllerAttributeTrait; use ApiControllerContractTypeTrait; use ApiControllerContractTrait; + use ApiControllerAttributeTrait; }