fix tests

This commit is contained in:
Dennis Eichhorn 2023-09-27 14:42:42 +00:00
parent f8dd6ca1bd
commit 7daacab9c0
2 changed files with 5 additions and 2 deletions

View File

@ -333,7 +333,7 @@ final class ApiController extends Controller
// allow comments // allow comments
if ($request->hasData('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 */ /** @var \Modules\Comments\Controller\ApiController $commentApi */
$commnetList = $commentApi->createCommentList(); $commnetList = $commentApi->createCommentList();

View File

@ -83,9 +83,12 @@ final class Autoloader
} }
$class2 = $class; $class2 = $class;
$class3 = $class;
$pos = \stripos($class, '/'); $pos = \stripos($class, '/');
if ($pos !== false) { if ($pos !== false) {
$class3 = \substr($class, $pos + 1);
$pos = \stripos($class, '/', $pos + 1); $pos = \stripos($class, '/', $pos + 1);
if ($pos !== false) { if ($pos !== false) {
@ -94,7 +97,7 @@ final class Autoloader
} }
foreach (self::$paths as $path) { 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; include_once $file;
return; return;