From 2098eb832a75c5af0e0fc750939787ceff379623 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 27 Sep 2023 14:42:42 +0000 Subject: [PATCH] fix tests --- Admin/Routes/Web/Backend.php | 9 --------- Models/Unit.php | 2 +- tests/Autoloader.php | 5 ++++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Admin/Routes/Web/Backend.php b/Admin/Routes/Web/Backend.php index 751d180..212d3f5 100755 --- a/Admin/Routes/Web/Backend.php +++ b/Admin/Routes/Web/Backend.php @@ -52,15 +52,6 @@ return [ ], ], '^.*/organization/unit/create.*$' => [ - [ - 'dest' => '\Modules\Media\Controller\BackendController::setUpFileUploaderTrait', - 'verb' => RouteVerb::GET, - 'permission' => [ - 'module' => BackendController::NAME, - 'type' => PermissionType::CREATE, - 'state' => PermissionCategory::UNIT, - ], - ], [ 'dest' => '\Modules\Organization\Controller\BackendController:viewUnitCreate', 'verb' => RouteVerb::GET, diff --git a/Models/Unit.php b/Models/Unit.php index 96171f8..02b6972 100755 --- a/Models/Unit.php +++ b/Models/Unit.php @@ -59,7 +59,7 @@ class Unit implements \JsonSerializable * @var null|Unit * @since 1.0.0 */ - public ?self $parent; + public ?self $parent = null; /** * Description. diff --git a/tests/Autoloader.php b/tests/Autoloader.php index 00fd019..773a3eb 100755 --- a/tests/Autoloader.php +++ b/tests/Autoloader.php @@ -83,9 +83,12 @@ final class Autoloader } $class2 = $class; + $class3 = $class; $pos = \stripos($class, '/'); if ($pos !== false) { + $class3 = \substr($class, $pos + 1); + $pos = \stripos($class, '/', $pos + 1); if ($pos !== false) { @@ -94,7 +97,7 @@ final class Autoloader } foreach (self::$paths as $path) { - if (\is_file($file = $path . $class2 . '.php')) { + if (\is_file($file = $path . $class2 . '.php') && \stripos($file, $class3) !== false) { include_once $file; return;