Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 1 Aug 2019 01:15:47 +0000 (03:15 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 1 Aug 2019 02:35:38 +0000 (04:35 +0200)
- configKey's value should be string here
- word "method" is better describing
- rewrote single-line to multi-line
- added internal TODO

Signed-off-by: Roland Häder <roland@mxchange.org>
framework/main/classes/database/backend/lfdb_legacy/class_CachedLocalFileDatabase.php
framework/main/tests/filter/tests/configuration/classes/class_TestConfigurationLoadableClassesFilter.php
tests/framework/bootstrap/class_FrameworkBootstrapTest.php

index dd8c3356ac11711998cf4c78424d89d97acab73e..2e47f6fb718d98bdb2c38652cb57242b6690efcf 100644 (file)
@@ -490,7 +490,13 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
                        $this->setLastException($e);
 
                        // Throw an SQL exception
-                       throw new SqlException(array($this, sprintf('Cannot write data to table &#39;%s&#39;, is the table created?', $dataSetInstance->getTableName()), self::DB_CODE_TABLE_UNWRITEABLE), self::EXCEPTION_SQL_QUERY);
+                       throw new SqlException(array(
+                                       $this,
+                                       sprintf('Cannot write data to table &#39;%s&#39;, is the table created?', $dataSetInstance->getTableName()),
+                                       self::DB_CODE_TABLE_UNWRITEABLE
+                               ),
+                               self::EXCEPTION_SQL_QUERY
+                       );
                }
        }
 
@@ -609,6 +615,7 @@ class CachedLocalFileDatabase extends BaseDatabaseBackend implements DatabaseBac
         *
         * @param       $tableName              Name of the table we need the primary key from
         * @return      $primaryKey             Primary key column of the given table
+        * @todo        Rename method to getPrimaryKeyFromTableInfo()
         */
        public function getPrimaryKeyOfTable ($tableName) {
                // Default key is null
index e46919aba1fda99e4a0303cca6e49d8debf7e2c0..78ef72885d20188dad04d0f8cfac75c092774200 100644 (file)
@@ -83,15 +83,22 @@ class TestConfigurationLoadableClassesFilter extends BaseTestsFilter implements
 
                        // This may throw exceptions
                        try {
-                               // Is the class there?
-                               if (!class_exists($configValue)) {
+                               // Is the config entry valid and class is there?
+                               if (!is_string($configKey)) {
+                                       // Is not a string
+                                       self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('configKey=%s has unexpected type "%s". FAILED', $configKey, gettype($configKey)));
+
+                                       // Skip further tests
+                                       $failed++;
+                                       continue;
+                               } elseif (!class_exists($configValue)) {
                                        // Class not found
                                        self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" not found. FAILED', $configValue));
 
                                        // Skip further tests
                                        $failed++;
                                        continue;
-                               } // END - if
+                               }
                        } catch (InvalidArgumentException $e) {
                                // Maybe not conform?
                                self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('Class "%s" failed to load. Message: "%s"', $configValue, $e->getMessage()));
index e96065a511a618ce6a1f6df38e13a7b3a35178a9..89d796ea0b4af2fc55a576ca4e8bcc3aaff33671 100644 (file)
@@ -201,7 +201,7 @@ class FrameworkBootstrapTest extends TestCase {
 
        /**
         * Re-tests if detectServerAddress() is returning what it should for tests.
-        * This will always be 127.0.0.1. This call should not invoke
+        * This will always be 127.0.0.1. This method should not invoke
         * ConsoleTools's method as the configuration entry is already cached.
         */
        public function testConfigDetectServerAddressCached () {