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');
> }
>
>
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---