public function testConfigMergeComplexObjects()
{
$this->specify("Config objects does not merged properly", function () {
$config1 = new PhConfig(['controllersDir' => '../x/y/z', 'modelsDir' => '../x/y/z', 'database' => ['adapter' => 'Mysql', 'host' => 'localhost', 'username' => 'scott', 'password' => 'cheetah', 'name' => 'test_db', 'charset' => ['primary' => 'utf8'], 'alternatives' => ['primary' => 'latin1', 'second' => 'latin1']]]);
$config2 = new PhConfig(['modelsDir' => '../x/y/z', 'database' => ['adapter' => 'Postgresql', 'host' => 'localhost', 'username' => 'peter', 'options' => ['case' => 'lower', \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'], 'alternatives' => ['primary' => 'swedish', 'third' => 'american']]]);
$config1->merge($config2);
$expected = PhConfig::__set_state(['controllersDir' => '../x/y/z', 'modelsDir' => '../x/y/z', 'database' => PhConfig::__set_state(['adapter' => 'Postgresql', 'host' => 'localhost', 'username' => 'peter', 'password' => 'cheetah', 'name' => 'test_db', 'charset' => PhConfig::__set_state(['primary' => 'utf8']), 'alternatives' => PhConfig::__set_state(['primary' => 'swedish', 'second' => 'latin1', 'third' => 'american']), 'options' => PhConfig::__set_state(['case' => 'lower', (string) \PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'])])]);
expect($config1)->equals($expected);
});
}