]> git.mxchange.org Git - core.git/blobdiff - application/tests/class_ApplicationHelper.php
Continued:
[core.git] / application / tests / class_ApplicationHelper.php
index 5224a07e997704a4a254f7c5471cabdf3c249b10..3d531efd40dc34f20f27eaf9ef6efb398f188cbf 100644 (file)
@@ -5,12 +5,13 @@ namespace Org\Mxchange\CoreFramework\Helper\Application;
 // Import framework stuff
 use Org\Mxchange\CoreFramework\Application\BaseApplication;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Loader\ClassLoader;
 use Org\Mxchange\CoreFramework\Manager\ManageableApplication;
+use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
 use Org\Mxchange\CoreFramework\Registry\Registerable;
 use Org\Mxchange\CoreFramework\Template\CompileableTemplate;
-use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
+use Org\Mxchange\CoreFramework\Utils\Strings\StringUtils;
 
 /**
  * A class holding general data about the application and some methods for
@@ -35,7 +36,7 @@ use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  *
  * This program is free software: you can redistribute it and/or modify
@@ -57,7 +58,7 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -111,9 +112,6 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                // Register core tests
                ClassLoader::registerTestsPath('framework/main/tests');
 
-               // Register own tests
-               ClassLoader::registerTestsPath('application/tests/tests');
-
                // Scan for them now
                ClassLoader::scanTestsClasses();
        }
@@ -140,16 +138,17 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
                        $requestInstance->setRequestElement('command', $commandName);
                }
 
-               // Get a controller resolver
-               $resolverClass = sprintf(
-                       'Org\Mxchange\CoreFramework\Tests\Resolver\Controller\%s',
-                       StringUtils::convertToClassName(sprintf(
-                               '%s_%s_controller_resolver',
-                               $this->getAppShortName(),
-                               FrameworkBootstrap::getRequestTypeFromSystem()
-                       ))
+               // Configuration entry key
+               $configEntry = sprintf(
+                       '%s_%s_controller_resolver_class',
+                       $this->getAppShortName(),
+                       FrameworkBootstrap::getRequestTypeFromSystem()
                );
-               $resolverInstance = ObjectFactory::createObjectByName($resolverClass, array($commandName));
+
+               // Get a controller resolver instance
+               $resolverInstance = ObjectFactory::createObjectByConfiguredName($configEntry, [
+                       $commandName,
+               ]);
 
                // Get a controller instance as well
                $this->setControllerInstance($resolverInstance->resolveController());
@@ -189,12 +188,12 @@ class ApplicationHelper extends BaseApplication implements ManageableApplication
        /**
         * Assigns extra application-depending data
         *
-        * @param       $templateInstance       An instance of a CompileableTemplate
+        * @param       $templateInstance       An instance of a CompileableTemplate class
         * @return      void
         * @todo        Nothing to add?
         */
        public function assignExtraTemplateData (CompileableTemplate $templateInstance) {
-               $this->partialStub('Unfinished method. templateInstance=' . $templateInstance->__toString());
+               DebugMiddleware::getSelfInstance()->partialStub('Unfinished method. templateInstance=' . $templateInstance->__toString());
        }
 
 }