Allow DNS resolver to become quiet about its operations
[core.git] / tests / framework / config / FrameworkConfigurationTest.php
index 8e33a28acb65351244b01d33507bfb59c6711e51..324a8fe0ad52c49e21e1736dc6ff19d29db4a114 100644 (file)
@@ -4,6 +4,7 @@
 namespace CoreFramework\Configuration;
 
 // Inport framework stuff
+use CoreFramework\Console\Tools\ConsoleTools;
 use CoreFramework\Loader\ClassLoader;
 use CoreFramework\Generic\NullPointerException;
 
@@ -38,6 +39,11 @@ class FrameworkConfigurationTest extends TestCase {
         */
        private static $configInstance = NULL;
 
+       /**
+        * Own IP address
+        */
+       private static $ipAddress = FALSE;
+
        /**
         * Setup test case
         */
@@ -72,6 +78,12 @@ class FrameworkConfigurationTest extends TestCase {
                 */
                ClassLoader::enableStrictNamingConventionCheck(FALSE);
 
+               // Quiet DNS resolver as this is not wanted here
+               self::$configInstance->setConfigEntry('quiet_dns_resolver', TRUE);
+
+               // Lookup own IP address
+               self::$ipAddress = ConsoleTools::acquireSelfIpAddress();
+
                // Trace message
                //* NOISY-DEBUG: */ printf('[%s:%d]: EXIT!' . PHP_EOL, __METHOD__, __LINE__);
        }
@@ -630,7 +642,7 @@ class FrameworkConfigurationTest extends TestCase {
                $serverAddress = self::$configInstance->detectServerAddress();
 
                // Should be the same
-               $this->assertEquals('127.0.0.1', $serverAddress);
+               $this->assertEquals(self::$ipAddress, $serverAddress);
        }
 
        /**
@@ -643,7 +655,7 @@ class FrameworkConfigurationTest extends TestCase {
                $serverAddress = self::$configInstance->detectServerAddress();
 
                // Should be the same
-               $this->assertEquals('127.0.0.1', $serverAddress);
+               $this->assertEquals(self::$ipAddress, $serverAddress);
        }
 
        /**
@@ -749,6 +761,9 @@ class FrameworkConfigurationTest extends TestCase {
 
                // Should be equal
                $this->assertEquals('127.0.0.1', $serverAddress);
+
+               // Set old back
+               self::$configInstance->setServerAddress(self::$ipAddress);
        }
 
 }