From 59404d7909b21682ec0782778452a8a70e38b25e Mon Sep 17 00:00:00 2001 From: ArthurHoaro Date: Wed, 18 May 2016 21:43:59 +0200 Subject: Introduce a configuration manager (not plugged yet) --- tests/config/ConfigManagerTest.php | 48 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 tests/config/ConfigManagerTest.php (limited to 'tests/config/ConfigManagerTest.php') diff --git a/tests/config/ConfigManagerTest.php b/tests/config/ConfigManagerTest.php new file mode 100644 index 00000000..1b6358f3 --- /dev/null +++ b/tests/config/ConfigManagerTest.php @@ -0,0 +1,48 @@ +conf = ConfigManager::getInstance(); + } + + public function tearDown() + { + @unlink($this->conf->getConfigFile()); + } + + public function testSetWriteGet() + { + // This won't work with ConfigPhp. + $this->markTestIncomplete(); + + $this->conf->set('paramInt', 42); + $this->conf->set('paramString', 'value1'); + $this->conf->set('paramBool', false); + $this->conf->set('paramArray', array('foo' => 'bar')); + $this->conf->set('paramNull', null); + + $this->conf->write(true); + $this->conf->reload(); + + $this->assertEquals(42, $this->conf->get('paramInt')); + $this->assertEquals('value1', $this->conf->get('paramString')); + $this->assertFalse($this->conf->get('paramBool')); + $this->assertEquals(array('foo' => 'bar'), $this->conf->get('paramArray')); + $this->assertEquals(null, $this->conf->get('paramNull')); + } + +} \ No newline at end of file -- cgit v1.2.3