From 7daacab9c0140a09b76de09cb334850913331ce1 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 27 Sep 2023 14:42:42 +0000 Subject: [PATCH] fix tests --- Controller/ApiController.php | 2 +- tests/Autoloader.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Controller/ApiController.php b/Controller/ApiController.php index b06d52a..f7978c5 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -333,7 +333,7 @@ final class ApiController extends Controller // allow comments if ($request->hasData('allow_comments') - && ($commentApi = $this->app->moduleManager->get('Comments'))::ID > 0 + && ($commentApi = $this->app->moduleManager->get('Comments', 'Api'))::ID > 0 ) { /** @var \Modules\Comments\Controller\ApiController $commentApi */ $commnetList = $commentApi->createCommentList(); diff --git a/tests/Autoloader.php b/tests/Autoloader.php index 10e6d48..f6fba7f 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;