From 8af158bc6fdb450493f24479d744d5da25a1262b Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Wed, 27 Sep 2023 14:42:42 +0000 Subject: [PATCH] fix tests --- tests/Admin/AdminTest.php | 2 +- tests/Autoloader.php | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/Admin/AdminTest.php b/tests/Admin/AdminTest.php index 3add29f..1cc3342 100644 --- a/tests/Admin/AdminTest.php +++ b/tests/Admin/AdminTest.php @@ -21,7 +21,7 @@ final class AdminTest extends \PHPUnit\Framework\TestCase { protected const NAME = 'StockTaking'; - protected const URI_LOAD = 'http://127.0.0.1/en/warehouse/stocktaking'; + protected const URI_LOAD = 'http://127.0.0.1/en/backend/warehouse/stocktaking'; use \tests\Modules\ModuleTestTrait; } diff --git a/tests/Autoloader.php b/tests/Autoloader.php index d77677d..5272f95 100644 --- 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;