public function save()
{
$properties = $this->getProperties();
try {
foreach ($properties as $property) {
$property->save();
}
return true;
} catch (\Exception $e) {
throw new \Gc\Exception($e->getMessage());
}
}
/** * Test * * @return void */ public function testSaveWithWrongValues() { $configuration = Registry::get('Application')->getConfig(); if ($configuration['db']['driver'] == 'pdo_mysql') { $this->markTestSkipped('Mysql does not thrown exception.'); } $this->setExpectedException('Gc\\Exception'); $this->property->setIdentifier(null); $this->object->setProperties(array($this->property->getData())); $this->assertFalse($this->object->save()); }