From a71e46f568a05dce17a065c015288b851924c915 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/Install/SearchCommands.php | 2 +- Admin/Routes/Web/Backend.php | 2 +- Controller/BackendController.php | 2 +- Controller/Controller.php | 8 ++++---- tests/Admin/AdminTest.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Admin/Install/SearchCommands.php b/Admin/Install/SearchCommands.php index 8a0bdbc..227a333 100755 --- a/Admin/Install/SearchCommands.php +++ b/Admin/Install/SearchCommands.php @@ -22,7 +22,7 @@ return [ 'dest' => '\Modules\Navigation\Controller\SearchController:searchGoto', 'verb' => RouteVerb::ANY, 'permission' => [ - 'module' => SearchController::MODULE_NAME, + 'module' => SearchController::NAME, 'type' => PermissionType::READ, ], ], diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index cc281e0..537a907 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -22,7 +22,7 @@ return [ 'dest' => '\Modules\Navigation\Controller\BackendController:viewModuleSettings', 'verb' => RouteVerb::GET, 'permission' => [ - 'module' => BackendController::MODULE_NAME, + 'module' => BackendController::NAME, 'type' => PermissionType::READ, 'state' => \Modules\Admin\Models\PermissionState::MODULE, ], diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 8714ee5..c9fc7e2 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -182,7 +182,7 @@ final class BackendController extends Controller $view->setData('navigation', $navigation); if (\is_file(__DIR__ . '/../Admin/Settings/Theme/Backend/settings.tpl.php')) { - $view->setTemplate('/Modules/' . static::MODULE_NAME . '/Admin/Settings/Theme/Backend/settings'); + $view->setTemplate('/Modules/' . static::NAME . '/Admin/Settings/Theme/Backend/settings'); } else { $view->setTemplate('/Modules/Admin/Theme/Backend/modules-settings'); } diff --git a/Controller/Controller.php b/Controller/Controller.php index 6bdf5ab..d7b2264 100755 --- a/Controller/Controller.php +++ b/Controller/Controller.php @@ -33,7 +33,7 @@ class Controller extends ModuleAbstract * @var string * @since 1.0.0 */ - public const MODULE_PATH = __DIR__ . '/../'; + public const PATH = __DIR__ . '/../'; /** * Module version. @@ -41,7 +41,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. @@ -49,7 +49,7 @@ class Controller extends ModuleAbstract * @var string * @since 1.0.0 */ - public const MODULE_NAME = 'Navigation'; + public const NAME = 'Navigation'; /** * Module id. @@ -57,7 +57,7 @@ class Controller extends ModuleAbstract * @var int * @since 1.0.0 */ - public const MODULE_ID = 1000500000; + public const ID = 1000500000; /** * Providing. diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index e82d1dd..a1209ea 100755 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -25,7 +25,7 @@ use phpOMS\Uri\HttpUri; */ class AdminTest extends \PHPUnit\Framework\TestCase { - protected const MODULE_NAME = 'Navigation'; + protected const NAME = 'Navigation'; protected const URI_LOAD = '';