]> git.mxchange.org Git - core.git/blobdiff - tests/framework/config/FrameworkConfigurationTest.php
Continued a bit:
[core.git] / tests / framework / config / FrameworkConfigurationTest.php
index 324a8fe0ad52c49e21e1736dc6ff19d29db4a114..d3e8ccd5fc7d992d696bd702d705978443505597 100644 (file)
@@ -534,6 +534,75 @@ class FrameworkConfigurationTest extends TestCase {
                self::$configInstance->unsetConfigEntry(NULL);
        }
 
+       /**
+        * Tests unsetting boolean key
+        */
+       public function testUnsettingBooleanConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->unsetConfigEntry(FALSE);
+       }
+
+       /**
+        * Tests unsetting decimal key
+        */
+       public function testUnsettingDecimalConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->unsetConfigEntry(12345);
+       }
+
+       /**
+        * Tests unsetting float key
+        */
+       public function testUnsettingFloatConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->unsetConfigEntry(123.45);
+       }
+
+       /**
+        * Tests unsetting array key
+        */
+       public function testUnsettingArrayConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->unsetConfigEntry(array());
+       }
+
+       /**
+        * Tests unsetting object key
+        */
+       public function testUnsettingObjectConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->unsetConfigEntry($this);
+       }
+
+       /**
+        * Tests unsetting resource key
+        */
+       public function testUnsettingResourceConfigKey () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Init some resource
+               $resource = fopen(__FILE__, 'r');
+
+               // Test it
+               self::$configInstance->unsetConfigEntry($resource);
+       }
+
        /**
         * Tests unsetting an empty key
         */
@@ -603,6 +672,75 @@ class FrameworkConfigurationTest extends TestCase {
                self::$configInstance->setDefaultTimezone(NULL);
        }
 
+       /**
+        * Tests setting a boolean default timezone
+        */
+       public function testSettingBooleanDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->setDefaultTimezone(FALSE);
+       }
+
+       /**
+        * Tests setting a decimal default timezone
+        */
+       public function testSettingDecimalDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->setDefaultTimezone(12345);
+       }
+
+       /**
+        * Tests setting a float default timezone
+        */
+       public function testSettingFloatDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->setDefaultTimezone(123.45);
+       }
+
+       /**
+        * Tests setting an array default timezone
+        */
+       public function testSettingArrayDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->setDefaultTimezone(array());
+       }
+
+       /**
+        * Tests setting an object default timezone
+        */
+       public function testSettingObjectDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Test it
+               self::$configInstance->setDefaultTimezone($this);
+       }
+
+       /**
+        * Tests setting a resource default timezone
+        */
+       public function testSettingResourceDefaultTimezone () {
+               // Will throw this exception
+               $this->expectException(InvalidArgumentException::class);
+
+               // Init some resource
+               $resource = fopen(__FILE__, 'r');
+
+               // Test it
+               self::$configInstance->setDefaultTimezone($resource);
+       }
+
        /**
         * Tests setting an empty default timezone
         */