Added new test for Config.
The test checks if instances from Config->getConfig() are the same.
This commit is contained in:
parent
53f597f947
commit
ef82ea3463
|
@ -0,0 +1,5 @@
|
|||
<?php
|
||||
|
||||
return array(
|
||||
'key' => 'value'
|
||||
);
|
|
@ -108,4 +108,20 @@ class configTest extends CoreTestAbstract
|
|||
$this->assertFalse(in_array('tests/config/testRemoveConfigPath', $this->config->getConfigPaths()));
|
||||
}
|
||||
|
||||
public function testSameConfigObject()
|
||||
{
|
||||
$config = $this->config->getConfig('testsameconfigobject', array('tests/config/testSameConfigObject'));
|
||||
$config2 = $this->config->getConfig('testsameconfigobject', array('tests/config/testSameConfigObject'));
|
||||
|
||||
// First test if the objects are the same instance
|
||||
$this->assertSame($config, $config2);
|
||||
|
||||
// First test the existing key
|
||||
$this->assertEquals($config->key, 'value');
|
||||
|
||||
// Change it and test if it's different now
|
||||
$config->key = 'other_value';
|
||||
$this->assertEquals($config2->key, 'other_value');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue