]> git.mxchange.org Git - core.git/blobdiff - application/tests/classes/commands/console/class_TestsConsoleMainCommand.php
Continued:
[core.git] / application / tests / classes / commands / console / class_TestsConsoleMainCommand.php
index ce512ff7ac7a3e860a8fe4435c354ea3d8148c32..91bb107ec35b4b9f785ddbf7c4506dea5a929669 100644 (file)
@@ -1,23 +1,23 @@
 <?php
 // Own namespace
-namespace CoreFramework\Tests\Command;
+namespace Org\Mxchange\CoreFramework\Tests\Command;
 
 // Import framework stuff
-use CoreFramework\Command\BaseCommand;
-use CoreFramework\Command\Commandable;
-use CoreFramework\Controller\Controller;
-use CoreFramework\Factory\ObjectFactory;
-use CoreFramework\Registry\Registry;
-use CoreFramework\Request\Requestable;
-use CoreFramework\Resolver\Command\CommandResolver;
-use CoreFramework\Response\Responseable;
+use Org\Mxchange\CoreFramework\Command\BaseCommand;
+use Org\Mxchange\CoreFramework\Command\Commandable;
+use Org\Mxchange\CoreFramework\Controller\Controller;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
+use Org\Mxchange\CoreFramework\Registry\Object\ObjectRegistry;
+use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Resolver\Command\CommandResolver;
+use Org\Mxchange\CoreFramework\Response\Responseable;
 
 /**
  * A command for the 'main' routine
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2015 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -40,7 +40,7 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -71,16 +71,18 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable {
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
                // Debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Starting tests ... ---');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONSOLE-MAIN-COMMAND: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('MAIN: --- Starting tests ... ---');
 
                // Get controller
-               $controllerInstance = Registry::getRegistry()->getInstance('controller');
+               $controllerInstance = ObjectRegistry::getRegistry('generic')->getInstance('controller');
 
                // Run all tests
                $controllerInstance->executeTestsFilters($requestInstance, $responseInstance);
 
                // Debug message
-               self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main ... ---');
+               self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('MAIN: --- Leaving main ... ---');
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONSOLE-MAIN-COMMAND: EXIT!');
        }
 
        /**
@@ -92,10 +94,14 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable {
         */
        public function addExtraFilters (Controller $controllerInstance, Requestable $requestInstance) {
                // Add pre filters (e.g. for requirements checks)
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('TESTS-CONSOLE-MAIN-COMMAND: controllerInstance=%s,requestInstance=%s - CALLED!', $controllerInstance->__toString(), $requestInstance->__toString()));
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('tests_php_requirements_filter_class'));
 
                // Add 'tests' filters which will run the actual tests
                $controllerInstance->addTestsFilter(ObjectFactory::createObjectByConfiguredName('tests_configuration_classes_loadable_test_filter_class'));
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('TESTS-CONSOLE-MAIN-COMMAND: EXIT!');
        }
 
 }