4 * Unit tests for Class ConfigManagerTest
6 * Note: it only test the manager with ConfigJson,
7 * ConfigPhp is only a workaround to handle the transition to JSON type.
9 class ConfigManagerTest
extends \PHPUnit_Framework_TestCase
16 public function setUp()
18 ConfigManager
::$CONFIG_FILE = 'tests/config/config';
19 $this->conf
= ConfigManager
::getInstance();
22 public function tearDown()
24 @unlink($this->conf
->getConfigFile());
27 public function testSetWriteGet()
29 // This won't work with ConfigPhp.
30 $this->markTestIncomplete();
32 $this->conf
->set('paramInt', 42);
33 $this->conf
->set('paramString', 'value1');
34 $this->conf
->set('paramBool', false);
35 $this->conf
->set('paramArray', array('foo' => 'bar'));
36 $this->conf
->set('paramNull', null);
38 $this->conf
->write(true);
39 $this->conf
->reload();
41 $this->assertEquals(42, $this->conf
->get('paramInt'));
42 $this->assertEquals('value1', $this->conf
->get('paramString'));
43 $this->assertFalse($this->conf
->get('paramBool'));
44 $this->assertEquals(array('foo' => 'bar'), $this->conf
->get('paramArray'));
45 $this->assertEquals(null, $this->conf
->get('paramNull'));