]> git.mxchange.org Git - core.git/blobdiff - framework/main/tests/controller/console/class_TestsConsoleDefaultNewsController.php
Continued:
[core.git] / framework / main / tests / controller / console / class_TestsConsoleDefaultNewsController.php
index afa29d45566c0cda56ae11bd5a721ac2f2115566..589c80d5cbb0f0b27c8bb49d66e7b0f2d3baa867 100644 (file)
@@ -16,7 +16,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.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
  * @link               http://www.shipsimu.org
  *
@@ -41,12 +41,17 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
         */
        private function __construct () {
                // Call parent constructor
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: CONSTRUCTED!');
                parent::__construct(__CLASS__);
 
                // Init additional filter chains
-               foreach (array('bootstrap', 'tests', 'shutdown') as $filterChain) {
+               foreach (['bootstrap', 'tests', BaseController::FILTER_CHAIN_SHUTDOWN] as $filterChain) {
+                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Initializing filterChain=%s ...', $filterChain));
                        $this->initFilterChain($filterChain);
-               } // END - foreach
+               }
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
        }
 
        /**
@@ -57,6 +62,7 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
         */
        public static final function createTestsConsoleDefaultNewsController (CommandResolver $resolverInstance) {
                // Create the instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: resolverInstance=%s - CALLED!', $resolverInstance->__toString()));
                $controllerInstance = new TestsConsoleDefaultNewsController();
 
                // Set the command resolver
@@ -67,6 +73,7 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
                $controllerInstance->addPreFilter(ObjectFactory::createObjectByConfiguredName('news_process_filter_class'));
 
                // Return the prepared instance
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: controllerInstance=%s - EXIT!', $controllerInstance->__toString()));
                return $controllerInstance;
        }
 
@@ -79,6 +86,7 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
         */
        public function handleRequest (Requestable $requestInstance, Responseable $responseInstance) {
                // Get the command instance from the resolver by sending a request instance to the resolver
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: requestInstance=%s,responseInstance=%s - CALLED!', $requestInstance->__toString(), $responseInstance->__toString()));
                $commandInstance = $this->getResolverInstance()->resolveCommandByRequest($requestInstance);
 
                // Add more filters by the command
@@ -88,7 +96,8 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
                $this->executePreFilters($requestInstance, $responseInstance);
 
                // This request was valid! :-D
-               $requestInstance->requestIsValid();
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking requestInstance->setIsRequestValid(TRUE) ...');
+               $requestInstance->setIsRequestValid(TRUE);
 
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
@@ -97,7 +106,11 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
                $this->executePostFilters($requestInstance, $responseInstance);
 
                // Flush the response out
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: Invoking responseInstance->flushBuffer() ...');
                $responseInstance->flushBuffer();
+
+               // Trace message
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('TEST-CONSOLE-DEFAULT-NEWS-CONTROLLER: EXIT!');
        }
 
        /**