]> git.mxchange.org Git - core.git/commitdiff
Continued:
authorRoland Haeder <roland@mxchange.org>
Sun, 26 Feb 2017 19:09:07 +0000 (20:09 +0100)
committerRoland Haeder <roland@mxchange.org>
Tue, 28 Feb 2017 21:11:02 +0000 (22:11 +0100)
- fixed some configuration entries, missing namespace
- output nice statistics about passed and failed tests

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/config.php
framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php

index 89fd2f3c42f01bfc3367988bb0e913bba86c8f9e..186e838aa4abc4ff474d640502d6f775bdf55885 100644 (file)
@@ -197,10 +197,10 @@ $cfg->setConfigEntry('file_output_class', 'CoreFramework\Stream\Filesystem\FileI
 $cfg->setConfigEntry('email_validator_filter_class', 'EmailValidatorFilter');
 
 // CFG: USERNAME-VALIDATOR-FILTER-CLASS
-$cfg->setConfigEntry('username_validator_filter_class', 'UserNameValidatorFilter');
+$cfg->setConfigEntry('username_validator_filter_class', 'CoreFramework\Filter\Validator\Username\UserNameValidatorFilter');
 
 // CFG: USERNAME-IS-GUEST-FILTER-CLASS
-$cfg->setConfigEntry('username_is_guest_filter_class', 'UserNameIsGuestFilter');
+$cfg->setConfigEntry('username_is_guest_filter_class', 'CoreFramework\Filter\User\Username\UserNameIsGuestFilter');
 
 // CFG: PASSWORD-VALIDATOR-FILTER-CLASS
 $cfg->setConfigEntry('password_validator_filter_class', 'PasswordValidatorFilter');
@@ -209,10 +209,10 @@ $cfg->setConfigEntry('password_validator_filter_class', 'PasswordValidatorFilter
 $cfg->setConfigEntry('rules_accepted_filter_class', 'RulesAcceptedFilter');
 
 // CFG: USERNAME-VERIFIER-FILTER-CLASS
-$cfg->setConfigEntry('username_verifier_filter_class', 'UserNameVerifierFilter');
+$cfg->setConfigEntry('username_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserNameVerifierFilter');
 
 // CFG: USER-GUEST-VERIFIER-FILTER-CLASS
-$cfg->setConfigEntry('user_guest_verifier_filter_class', 'UserGuestVerifierFilter');
+$cfg->setConfigEntry('user_guest_verifier_filter_class', 'CoreFramework\Filter\Verifier\User\UserGuestVerifierFilter');
 
 // CFG: EMAIL-VERIFIER-FILTER-CLASS
 $cfg->setConfigEntry('email_verifier_filter_class', 'EmailVerifierFilter');
@@ -233,10 +233,10 @@ $cfg->setConfigEntry('password_change_filter_class', 'PasswordChangeFilter');
 $cfg->setConfigEntry('account_password_filter_class', 'AccountPasswordVerifierFilter');
 
 // CFG: USER-STATUS-FILTER-CLASS
-$cfg->setConfigEntry('user_status_filter_class', 'UserStatusVerifierFilter');
+$cfg->setConfigEntry('user_status_filter_class', 'CoreFramework\Filter\Verifier\User\UserStatusVerifierFilter');
 
 // CFG: USER-UNCONFIRMED-FILTER-CLASS
-$cfg->setConfigEntry('user_unconfirmed_filter_class', 'UserUnconfirmedVerifierFilter');
+$cfg->setConfigEntry('user_unconfirmed_filter_class', 'CoreFramework\Filter\Verifier\User\UserUnconfirmedVerifierFilter');
 
 // CFG: CRYPTO-CLASS
 $cfg->setConfigEntry('crypto_class', 'CryptoHelper');
index b6f49a7ae455b0a05c548ffba18e4505c096c1be..cf2ff995e9e3a3df474d838f9b689b385ef74d7c 100644 (file)
@@ -66,6 +66,10 @@ class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements
         * @todo        0% done
         */
        public function execute (Requestable $requestInstance, Responseable $responseInstance) {
+               // Init counter
+               $passed = 0;
+               $failed = 0;
+
                // Loop through all configuration keys
                foreach ($this->getConfigInstance()->getConfigurationArray() as $configKey => $configValue) {
                        // Key must end with _class
@@ -85,6 +89,7 @@ class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements
                                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" not found. FAILED', $configValue));
 
                                        // Skip further tests
+                                       $failed++;
                                        continue;
                                } // END - if
                        } catch (InvalidArgumentException $e) {
@@ -92,13 +97,18 @@ class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" failed to load. Message: "%s"', $configValue, $e->getMessage()));
 
                                // Skip further tests
+                               $failed++;
                                continue;
                        }
 
                        // class_exists() didn't fail
                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" loaded successfully. OKAY', $configValue));
+                       $passed++;
                } // END - foreach
 
+               // Output result
+               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Test result: %d okay, %d failed (%0.02f%% passed)', $passed, $failed, ($passed / ($passed + $failed))));
+
                // Implement this!
                $this->partialStub('Please implement this method.');
        }