Continued:
authorRoland Haeder <roland@mxchange.org>
Sun, 26 Feb 2017 14:18:57 +0000 (15:18 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:11:02 +0000 (22:11 +0100)
- added stub class for testing loadable configured class names
- added "import" of ReflectionClass (SPL)
- some tpzos fixed

Signed-off-by: Roland H├Ąder <roland@mxchange.org>
application/tests/classes/commands/console/class_TestsConsoleMainCommand.php
application/tests/classes/controller/console/class_TestsConsoleDefaultNewsController.php
application/tests/classes/filter/tests/class_Tests
application/tests/classes/filter/tests/configuration/.htaccess [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/class_TestConfiguration [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/classes/.htaccess [new file with mode: 0644]
application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php [new file with mode: 0644]
application/tests/config.php
framework/config.php
framework/main/classes/class_BaseFrameworkSystem.php
framework/main/classes/controller/class_BaseController.php

index d6a5f38..ce512ff 100644 (file)
@@ -73,8 +73,11 @@ class TestsConsoleMainCommand extends BaseCommand implements Commandable {
                // Debug message
                self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Starting tests ... ---');
 
-               // Get a registry and the application instance from it
-               $applicationInstance = Registry::getRegistry()->getInstance('app');
+               // Get controller
+               $controllerInstance = Registry::getRegistry()->getInstance('controller');
+
+               // Run all tests
+               $controllerInstance->executeTestsFilters($requestInstance, $responseInstance);
 
                // Debug message
                self::createDebugInstance(__CLASS__)->debugOutput('MAIN: --- Leaving main ... ---');
index cc86661..d86ebf3 100644 (file)
@@ -93,7 +93,7 @@ class TestsConsoleDefaultNewsController extends BaseController implements Contro
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
 
-               // Run the pre filters
+               // Run the post filters
                $this->executePostFilters($requestInstance, $responseInstance);
 
                // Flush the response out
index 9fa7bd8..9f84cde 100644 (file)
@@ -6,6 +6,7 @@ namespace CoreFramework\Tests\Filter\!!!;
 use CoreFramework\Filter\Filterable;
 use CoreFramework\Request\Requestable;
 use CoreFramework\Response\Responseable;
+use CoreFramework\Tests\Filter\BaseTestsFilter;
 
 /**
  * A ??? filter for tests
diff --git a/application/tests/classes/filter/tests/configuration/.htaccess b/application/tests/classes/filter/tests/configuration/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/filter/tests/configuration/class_TestConfiguration b/application/tests/classes/filter/tests/configuration/class_TestConfiguration
new file mode 100644 (file)
index 0000000..76afc51
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+// Own namespace
+namespace CoreFramework\Tests\Filter\Configuration\!!!;
+
+// Import framework stuff
+use CoreFramework\Filter\Filterable;
+use CoreFramework\Request\Requestable;
+use CoreFramework\Response\Responseable;
+use CoreFramework\Tests\Filter\BaseTestsFilter;
+
+/**
+ * A ??? filter for tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestConfiguration???Filter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestConfiguration???Filter () {
+               // Get a new instance
+               $filterInstance = new TestConfiguration???Filter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Implement this!
+               $this->partialStub('Please implement this method.');
+       }
+
+}
diff --git a/application/tests/classes/filter/tests/configuration/classes/.htaccess b/application/tests/classes/filter/tests/configuration/classes/.htaccess
new file mode 100644 (file)
index 0000000..3a42882
--- /dev/null
@@ -0,0 +1 @@
+Deny from all
diff --git a/application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php b/application/tests/classes/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php
new file mode 100644 (file)
index 0000000..175f517
--- /dev/null
@@ -0,0 +1,70 @@
+<?php
+// Own namespace
+namespace CoreFramework\Tests\Filter\Configuration\Classes;
+
+// Import framework stuff
+use CoreFramework\Filter\Filterable;
+use CoreFramework\Request\Requestable;
+use CoreFramework\Response\Responseable;
+use CoreFramework\Tests\Filter\BaseTestsFilter;
+
+/**
+ * A LoadableClasses filter for tests
+ *
+ * @author             Roland Haeder <webmaster@ship-simu.org>
+ * @version            0.0.0
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
+ * @license            GNU GPL 3.0 or any newer version
+ * @link               http://www.ship-simu.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements Filterable {
+       /**
+        * Protected constructor
+        *
+        * @return      void
+        */
+       protected function __construct () {
+               // Call parent constructor
+               parent::__construct(__CLASS__);
+       }
+
+       /**
+        * Creates an instance of this filter class
+        *
+        * @return      $filterInstance         An instance of this filter class
+        */
+       public final static function createTestConfigurationLoadableClassesFilter () {
+               // Get a new instance
+               $filterInstance = new TestConfigurationLoadableClassesFilter();
+
+               // Return the instance
+               return $filterInstance;
+       }
+
+       /**
+        * Executes the filter with given request and response objects
+        *
+        * @param       $requestInstance        An instance of a class with an Requestable interface
+        * @param       $responseInstance       An instance of a class with an Responseable interface
+        * @return      void
+        * @todo        0% done
+        */
+       public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Implement this!
+               $this->partialStub('Please implement this method.');
+       }
+
+}
index 05b6268..0574a8d 100644 (file)
@@ -39,10 +39,10 @@ $cfg->setConfigEntry('default_tests_console_controller', 'main');
 // CFG: TESTS-CONSOLE-CMD-MAIN-RESOLVER-CLASS
 $cfg->setConfigEntry('tests_console_cmd_main_resolver_class', 'CoreFramework\Tests\Resolver\Command\TestsConsoleCommandResolver');
 
-// CFG: NEWS-DOWNLOAD-FILTER
+// CFG: NEWS-DOWNLOAD-FILTER-CLASS
 $cfg->setConfigEntry('news_download_filter_class', 'CoreFramework\Filter\News\NewsDownloadFilter');
 
-// CFG: NEWS-PROCESS-FILTER
+// CFG: NEWS-PROCESS-FILTER-CLASS
 $cfg->setConfigEntry('news_process_filter_class', 'CoreFramework\Filter\News\NewsProcessFilter');
 
 // CFG: NEWS-READER-MAIN-CLASS
@@ -53,3 +53,6 @@ $cfg->setConfigEntry('news_main_limit', 5);
 
 // CFG: TESTS-PHP-REQUIREMENTS-FILTER
 $cfg->setConfigEntry('tests_php_requirements_filter_class', 'CoreFramework\Tests\Filter\Requirements\TestsPhpRequirementsFilter');
+
+// CFG: TEST-CONFIGURATION-CLASSES-LOADABLE-TEST-FILTER-CLASS
+$cfg->setConfigEntry('tests_configuration_classes_loadable_test_filter_class', 'CoreFramework\Tests\Filter\Configuration\Classes\TestConfigurationLoadableClassesFilter');
index f524cbf..f389f4b 100644 (file)
@@ -193,49 +193,49 @@ $cfg->setConfigEntry('file_input_class', 'CoreFramework\Stream\Filesystem\FileIo
 // CFG: FILE-OUTPUT-CLASS
 $cfg->setConfigEntry('file_output_class', 'CoreFramework\Stream\Filesystem\FileIoStream');
 
-// CFG: EMAIL-VALIDATOR-FILTER
+// CFG: EMAIL-VALIDATOR-FILTER-CLASS
 $cfg->setConfigEntry('email_validator_filter_class', 'EmailValidatorFilter');
 
-// CFG: USERNAME-VALIDATOR-FILTER
+// CFG: USERNAME-VALIDATOR-FILTER-CLASS
 $cfg->setConfigEntry('username_validator_filter_class', 'UserNameValidatorFilter');
 
-// CFG: USERNAME-IS-GUEST-FILTER
+// CFG: USERNAME-IS-GUEST-FILTER-CLASS
 $cfg->setConfigEntry('username_is_guest_filter_class', 'UserNameIsGuestFilter');
 
-// CFG: PASSWORD-VALIDATOR-FILTER
+// CFG: PASSWORD-VALIDATOR-FILTER-CLASS
 $cfg->setConfigEntry('password_validator_filter_class', 'PasswordValidatorFilter');
 
-// CFG: RULES-ACCEPTED-FILTER
+// CFG: RULES-ACCEPTED-FILTER-CLASS
 $cfg->setConfigEntry('rules_accepted_filter_class', 'RulesAcceptedFilter');
 
-// CFG: USERNAME-VERIFIER-FILTER
+// CFG: USERNAME-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('username_verifier_filter_class', 'UserNameVerifierFilter');
 
-// CFG: USER-GUEST-VERIFIER-FILTER
+// CFG: USER-GUEST-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('user_guest_verifier_filter_class', 'UserGuestVerifierFilter');
 
-// CFG: EMAIL-VERIFIER-FILTER
+// CFG: EMAIL-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('email_verifier_filter_class', 'EmailVerifierFilter');
 
-// CFG: PASSWORD-VERIFIER-FILTER
+// CFG: PASSWORD-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('password_verifier_filter_class', 'PasswordVerifierFilter');
 
-// CFG: PASSWD-GUEST-VERIFIER-FILTER
+// CFG: PASSWD-GUEST-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('passwd_guest_verifier_filter_class', 'PasswordGuestVerifierFilter');
 
-// CFG: EMAIL-CHANGE-FILTER
+// CFG: EMAIL-CHANGE-FILTER-CLASS
 $cfg->setConfigEntry('email_change_filter_class', 'EmailChangeFilter');
 
-// CFG: PASSWORD-CHANGE-FILTER
+// CFG: PASSWORD-CHANGE-FILTER-CLASS
 $cfg->setConfigEntry('password_change_filter_class', 'PasswordChangeFilter');
 
-// CFG: ACCOUNT-PASSWORD-FILTER
+// CFG: ACCOUNT-PASSWORD-FILTER-CLASS
 $cfg->setConfigEntry('account_password_filter_class', 'AccountPasswordVerifierFilter');
 
-// CFG: USER-STATUS-FILTER
+// CFG: USER-STATUS-FILTER-CLASS
 $cfg->setConfigEntry('user_status_filter_class', 'UserStatusVerifierFilter');
 
-// CFG: USER-UNCONFIRMED-FILTER
+// CFG: USER-UNCONFIRMED-FILTER-CLASS
 $cfg->setConfigEntry('user_unconfirmed_filter_class', 'UserUnconfirmedVerifierFilter');
 
 // CFG: CRYPTO-CLASS
index 3ca59ca..423fe29 100644 (file)
@@ -33,6 +33,7 @@ use CoreFramework\Wrapper\Database\DatabaseWrapper;
 
 // Import SPL stuff
 use \stdClass;
+use \ReflectionClass;
 
 /**
  * The simulator system class is the super class of all other classes. This
index 6f8a1ec..97349d5 100644 (file)
@@ -135,7 +135,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
                        // Execute the command
                        $commandInstance->execute($requestInstance, $responseInstance);
 
-                       // Execute *very* generic ppost filters
+                       // Execute *very* generic post filters
                        $this->executePostFilters($requestInstance, $responseInstance);
                } // END - if
 
@@ -176,7 +176,7 @@ class BaseController extends BaseFrameworkSystem implements Registerable {
                // Execute the command
                $commandInstance->execute($requestInstance, $responseInstance);
 
-               // Run the pre filters
+               // Run the post filters
                $this->executePostFilters($requestInstance, $responseInstance);
 
                // Flush the response out