From 7b59d4637ed06f644dffc500aee3bbae5fb36cc2 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 28 Sep 2021 18:28:42 +0200 Subject: [PATCH] rename module constants and fix some unit test bugs --- Admin/Routes/Web/Backend.php | 36 ++++++++++++++++++------------------ Controller/Controller.php | 8 ++++---- tests/Admin/AdminTest.php | 2 +- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index edde489..69a2acc 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -23,7 +23,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewPersonalEntries', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::PERSONAL, ], @@ -34,7 +34,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewImpersonalEntries', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::IMPERSONAL, ], @@ -45,7 +45,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewEntries', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::ENTRY, ], @@ -56,7 +56,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewJournalList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::JOURNAL, ], @@ -67,7 +67,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewStackList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::STACK, ], @@ -78,7 +78,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewStackEntries', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::STACK, ], @@ -89,7 +89,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewStackArchiveList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::STACK, ], @@ -100,7 +100,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewStackCreate', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::CREATE, 'state' => PermissionState::STACK, ], @@ -111,7 +111,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewStackPredefinedList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::STACK, ], @@ -122,7 +122,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewGLList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::GL, ], @@ -133,7 +133,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewGLCreate', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::CREATE, 'state' => PermissionState::GL, ], @@ -144,7 +144,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewGLProfile', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::GL, ], @@ -155,7 +155,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::COST_CENTER, ], @@ -166,7 +166,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::ACCOUNT, ], @@ -177,7 +177,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::ACCOUNT, ], @@ -188,7 +188,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterProfile', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::ACCOUNT, ], @@ -200,7 +200,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostCenterList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::COST_CENTER, ], @@ -211,7 +211,7 @@ return [ 'dest' => '\Modules\Accounting\Controller\BackendController:viewCostObjectList', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => PermissionState::COST_OBJECT, ], diff --git a/Controller/Controller.php b/Controller/Controller.php index 5e966f3..e169965 100755 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -32,7 +32,7 @@ class Controller extends ModuleAbstract * @var string * @since 1.0.0 */ - public const MODULE_PATH = __DIR__ . '/../'; + public const PATH = __DIR__ . '/../'; /** * Module version. @@ -40,7 +40,7 @@ class Controller extends ModuleAbstract * @var string * @since 1.0.0 */ - public const MODULE_VERSION = '1.0.0'; + public const VERSION = '1.0.0'; /** * Module name. @@ -48,7 +48,7 @@ class Controller extends ModuleAbstract * @var string * @since 1.0.0 */ - public const MODULE_NAME = 'Accounting'; + public const NAME = 'Accounting'; /** * Module id. @@ -56,7 +56,7 @@ class Controller extends ModuleAbstract * @var int * @since 1.0.0 */ - public const MODULE_ID = 1002600000; + public const ID = 1002600000; /** * Providing. diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index 9212fb2..7ee8470 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -19,7 +19,7 @@ namespace Modules\Accounting\tests\Admin; */ class AccountingTest extends \PHPUnit\Framework\TestCase { - protected const MODULE_NAME = 'Accounting'; + protected const NAME = 'Accounting'; protected const URI_LOAD = 'http://127.0.0.1/en/backend/accounting';