Hi everyone,

I solve that problem in this way:

$browser = new sfTestFunctional(new sfBrowser());

$browser->
  info('Login')->

  // go to login page
  get('/login.php')->

  // log in
  with('form')->begin()->
    click('Signin', array(
      'signin' => array(
        'username' => sfConfig::get('FUNC_ADMIN_USER'),
        'password' => sfConfig::get('FUNC_ADMIN_PASS'))))->
  end()
;

$browser->
  get('/crForumForum/')->
  info(sprintf('User id %d', $browser->getUser()->getGuardUser()-
>getId()))
;

It works, so it seems I can use myUser class.
Hope this helps.

Bye

On Sep 23, 7:54 pm, mahadi <profi...@altmuehlnet.de> wrote:
> Hi,
>
> i found a similar post written some days before i wrote my question.
> Also no answers yet. Doesn't anybody know something concerning this
> issue?
>
> Regards
>
> mahadi
>
> On Sep 16, 7:25 pm, mahadi <profi...@altmuehlnet.de> wrote:
>
> > Hi folks,
>
> > im trying to get user information in a functional test.
>
> > Im using the sfDoctrineGuardPlugin and i want to get the users id. How
> > can i access user information in a functional test?
>
> > I tried already the following code, but it wont work as expected:
>
> > with('user')->begin()->
> >     isAttribute('sf_guard_user_id', 2)->
> > end()->
>
> > The browser toolbar in the dev environment shows the following:
>
> > options:
> >   ...
> > attributeHolder:
> >   sfGuardSecurityUser: { user_id: '2' }
> >   symfony/user/sfUser/attributes: {  }
> > ...
>
> > So i think i should be able to get this information.
>
> > Does anybody know how to do this?
>
> > Regards
>
> > mahadi
>
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to