Exemple #1
0
 public function testDataSourceConfig()
 {
     $dataSourceConfig = new DataSourceConfig();
     $dataSourceConfig->setKey('key');
     $dataSourceConfig->setType('\\PDO');
     $dataSourceConfig->addProperty('key1', 'value1');
     $dataSourceConfig->addProperty('key2', 'value2');
     $expected = "\\Phruts\\Config\\DataSourceConfig[key='key',type='\\\\PDO',key1='value1',key2='value2']";
     $this->assertEquals($expected, (string) $dataSourceConfig);
     // TODO: Test exception
     $dataSourceConfig->freeze();
     $this->setExpectedException('\\Phruts\\Exception\\IllegalStateException');
     $dataSourceConfig->setKey('expected');
 }