Esempio n. 1
0
 public function testSettings()
 {
     Configure::write('Cache.disable', true);
     $this->Dbo = ConnectionManager::getDataSource('test');
     $this->skipIf(!$this->Dbo instanceof Postgres);
     $config2 = $this->Dbo->config;
     $config2['settings']['datestyle'] = 'sql, dmy';
     ConnectionManager::create('test2', $config2);
     $dbo2 = new Postgres($config2, true);
     $expected = array(array('r' => date('d/m/Y')));
     $r = $dbo2->fetchRow('SELECT now()::date AS "r"');
     $this->assertEquals($expected, $r);
     $dbo2->execute('SET DATESTYLE TO ISO');
     $dbo2->disconnect();
 }