]> git.mxchange.org Git - core.git/blobdiff - tests/framework/config/FrameworkConfigurationTest.php
Continued:
[core.git] / tests / framework / config / FrameworkConfigurationTest.php
index 27fdc26b55625c1d7e72634666b1edebaad4c9b0..3a2db60bb81d37b8b314dcbe08a7db76571cc067 100644 (file)
@@ -394,4 +394,28 @@ class FrameworkConfigurationTest extends TestCase {
                $this->assertTrue(is_bool(self::$configInstance->isEnabled('single_server')));
        }
 
+       /**
+        * Tests if sorting the configuration array is always returning the same
+        * array (but sorted) back.
+        */
+       public function testConfigSortConfigurationArray () {
+               // First get configuration array
+               /* NOISY-DEBUG: */ printf('[%s:%d]: CALLED!' . PHP_EOL, __METHOD__, __LINE__);
+               $config = self::$configInstance->getConfigurationArray();
+
+               // Run sort method
+               /* NOISY-DEBUG: */ printf('[%s:%d]: config()=%d' . PHP_EOL, __METHOD__, __LINE__, count($config));
+               self::$configInstance->sortConfigurationArray();
+
+               // This should be an empty array
+               $diff = array_diff($config, self::$configInstance->getConfigurationArray());
+
+               // Check condition
+               /* NOISY-DEBUG: */ printf('[%s:%d]: diff()=%d' . PHP_EOL, __METHOD__, __LINE__, count($diff));
+               $this->assertTrue(count($diff) === 0);
+
+               // Trace message
+               /* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
+       }
+
 }