Yes, it's good news, :) i write my self, catch model from actions like sfTesterForm maybe it's feature you can add to official test suit. thanks for ansver.
On Mon, Dec 8, 2008 at 10:49 AM, Fabien Potencier <[EMAIL PROTECTED]> wrote: > > The good news is that sfTesterPropel exists. > > http://www.symfony-project.org/api/1_2/sfTesterPropel > > -- > Fabien Potencier > Sensio CEO - symfony lead developer > sensiolabs.com | symfony-project.com | aide-de-camp.org > Tél: +33 1 40 99 80 80 > > > Timu EREN wrote: >> hi folks, >> New test suite is very good, conguralations for that, bu i think some >> piece is missing, sfTesterPropel.class >> >> i think it's very good for functional test, if you set some values for >> model classes in your action we can't control in functional test, >> >> an examples: >> >> // $c is Confirmation model for retrieve confirmation key from db; >> >> $browser-> >> get('/confirm/'.$c->getConfirmationKey())-> >> with('request')->begin()-> >> isParameter('module', 'user')-> >> isParameter('action', 'confirm')-> >> end()-> >> with('user')->begin()-> >> isAuthneticated()-> >> end()-> >> info('check model for functional test')-> >> with('propel')->begin()-> >> setModelName('confirmation')-> >> setMethodName('retrieveByConfirmationKey', >> array($c->getConfirmationKey()))-> >> checkExists()-> >> checkValue('isEnabled', false)-> >> end()-> >> with('response')->begin()-> >> isStausCode(302)-> >> end(); >> >> >> in confirm action: >> >> function executeConfirm($request) >> { >> $confirm = >> ConfirmationPeer::retrieveByKey($request->getParameter('key')); >> if(!$confirm) >> { >> return sfView::ERROR; >> } >> >> $this->getUser()->setLogin($confirm->getUser()); >> $confirm->setIsEnabled(false); // we check in sfTester that value >> $confirm->save(); // maybe we forget execute save method in >> action, we check in sfTester >> >> $this->redirect('@homepage'); >> } >> >> >> >> > > > > > -- Saygılar && İyi Çalışmalar Timu EREN ( a.k.a selam ) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
