X-Git-Url: https://git.mxchange.org/?p=core.git;a=blobdiff_plain;f=tests%2Fframework%2Fconfig%2FFrameworkConfigurationTest.php;h=324a8fe0ad52c49e21e1736dc6ff19d29db4a114;hp=8e33a28acb65351244b01d33507bfb59c6711e51;hb=d368d588ce51693181e74a6bee9f96e8e78b96d4;hpb=e49824352d4ee089daaa8043f8463cc196d079ec diff --git a/tests/framework/config/FrameworkConfigurationTest.php b/tests/framework/config/FrameworkConfigurationTest.php index 8e33a28a..324a8fe0 100644 --- a/tests/framework/config/FrameworkConfigurationTest.php +++ b/tests/framework/config/FrameworkConfigurationTest.php @@ -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); } }