- * Tests setting a NULL default timezone
- */
- public function testSettingNullDefaultTimezone () {
- // Will throw this exception
- $this->expectException(NullPointerException::class);
-
- // Test it
- self::$configInstance->setDefaultTimezone(NULL);
- }
-
- /**
- * Tests setting an empty default timezone
- */
- public function testSettingEmptyDefaultTimezone () {
- // Will throw this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setDefaultTimezone('');
- }
-
- /**
- * Tests setting invalid timezone
- */
- public function testSettingInvalidDefaultTimezone () {
- // Expect Notice
- $this->expectException(Notice::class);
-
- // Try to set it
- self::$configInstance->setDefaultTimezone('!invalid!');
- }
-
- /**
- * Tests setting valid timezone
- */
- public function testSettingValidDefaultTimezone () {
- // Will be true
- $this->assertTrue(self::$configInstance->setDefaultTimezone('Europe/Berlin'));
- }
-
- /**
- * Tests if detectServerAddress is returning what it should for tests.
- * This will always be 127.0.0.1.
- */
- public function testConfigDetectServerAddress () {
- // Call it
- $serverAddress = self::$configInstance->detectServerAddress();
-
- // Should be the same
- $this->assertEquals(self::$ipAddress, $serverAddress);
- }
-
- /**
- * Re-tests if detectServerAddress is returning what it should for tests.
- * This will always be 127.0.0.1. This call should not invoke
- * ConsoleTools's method as the configuration entry is already cached.
- */
- public function testConfigDetectServerAddressCached () {
- // Call it
- $serverAddress = self::$configInstance->detectServerAddress();
-
- // Should be the same
- $this->assertEquals(self::$ipAddress, $serverAddress);
- }
-
- /**
- * Tests setting a NULL server address
- */
- public function testConfigSettingNullServerAddress () {
- // Expect this exception
- $this->expectException(NullPointerException::class);
-
- // Test it
- self::$configInstance->setServerAddress(NULL);
- }
-
- /**
- * Tests setting a boolean server address
- */
- public function testConfigSettingBooleanServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress(FALSE);
- }
-
- /**
- * Tests setting a decimal server address
- */
- public function testConfigSettingDecimalServerAddress () {
- // Expect this exception
- $this->expectException(InvalidArgumentException::class);
-
- // Test it
- self::$configInstance->setServerAddress(12345);
- }
-
- /**
- * Tests setting a float server address