Hi, thanks for the reply. This always worked for me and I am using it this way since the other way doesn't work :)
I should have pointed that out, I think. But I hoped that there would be the more direct approach of setting the user, because I can set the sfContext User to authenticated and he stays so until a get request, then the user is not auth anymore. If I auth him then again, he stays auth until the next get. So this is supposed to be the right user, but he refuses to stay authenticated. grrrrrr :) Maybe someone drop a thought in that :D -------- Original-Nachricht -------- > Datum: Sat, 27 Dec 2008 10:47:04 -0800 (PST) > Von: jL <[email protected]> > An: symfony users <[email protected]> > Betreff: [symfony-users] Re: How to retrieve the current user in testing? > > This is totally off the top of my head > > I'm afraid that I can't look into it to verify, as I gotta head out > the door shortly, BUT: > > Try to authenticate your user via the website. That is, use the actual > login form, so that you can authenticate in such a way that your > sfBrowser gets a valid session cookie to attach the authentication > state to. > > Good luck! > > > > jL > > > On Dec 24, 2:23 pm, [email protected] wrote: > > Hello, > > I have a hard time retrieving the current user when doing a functional > test > > > > Thats my call: $browser = new sfTestFunctional(new sfBrowser()); > > > > if I do sth like > > sfContext::getInstance()->getUser()->setAuthenticated(true); > > this works fine, but the next $browser->get() somehow resets the state, > if I check the isAuthenticated, it is always false. So I assume that this > user is not the user defined by the browser, but how can I retrieve this > user? > > the sfBrowser has a getUser(); but I can never retrieve it because PHP > says that I do a call on a non object: > > > > $b = new sfBrowser(); > > $browser = new sfTestFunctional($b); > > > > $b->getUser(); > > > > Please help and merry x-mas > > > > -- > > Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL > > für nur 16,37 Euro/mtl.!*http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a > > -- Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" 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-users?hl=en -~----------~----~----~----~------~----~------~--~---
