If only I could use this version, but I'm on the 1.0.21.

I don't know if i'm going on the best way but here is a part of my
test code:

include(dirname(__FILE__).'/../../../bootstrap/functional.php');

$database = new sfPropelDatabase();
$database->initialize(array (
  'dsn' => 'mysql://root:@localhost/******?encoding=utf8',
  'encoding' => 'utf8',
), '******');

$t = new sfTestBrowser();
$t->initialize();
$t->setAuth('login', 'password');
$t->call('alTransport/edit/id/12','get');

and what is expected is that this user can't call this page because he
didn't have the credential,


On May 13, 5:28 pm, J_Wesker <[email protected]> wrote:
> If you are using symfony 1.2 or above, and your are trying to make a
> functional test, you can use the sfTesterUser class like this:
>
> $browser->
>   get('/')->
>
>   with('user')->begin()->
>     isCulture('es')->
>     isAuthenticated(true)->
>     hasCredential('admin')->
>     isAttribute('sfguard_user_id', '3')->
>     isFlash('notice', '/foo/')->
>   end()
> ;
>
> I only have trouble with the isAttribute() method of this tester, I
> can not seem to accomplish this example test, but everything else
> works great!
>
> You can learn more about the tester classes on
>
> http://www.symfony-project.org/cookbook/1_2/en/test-application
>
> Cheers, mate!
>
> On May 12, 8:47 am, bedomon <[email protected]> wrote:
>
>
>
> > Hi,
>
> > Some of my actions need special credential, and I want to make test on
> > this feature. I dont's use the sfGuardPlugin in my apps so I don't
> > think i can use it for testing.
> > If someone can explain how I can do this test.
>
> > (I hope you understand my english)
>
> > thanks
>
> > --
> > 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 [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group 
> > athttp://groups.google.com/group/symfony-users?hl=en
>
> --
> 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 [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group 
> athttp://groups.google.com/group/symfony-users?hl=en

-- 
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 [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

Reply via email to