function testCreateThrowsExceptionIfRecordSaveIsUnsuccessfull() { $user =& $this->_mockModel('User'); $user->setReturnValue('save', false); $this->expectException('RecordNotSavedException'); FFactory::define('User'); FFactory::create('User', array('login' => 'joe')); }
function assoc($alias, $attribute = 'id') { $_this = self::getInstance(); $associated = FFactory::create($alias); return $associated[$_this->load($_this->models[$alias]['model'])->alias][$attribute]; }