testing - How to write a functional test with user authentication? -
i writing functional test page requires user authentication. using sfdoctrineguard plugin.
how authenticate user in test?
do have enter every test through sign in screen?
here incorrect code:
$b->post('/sfguardauth/signin', array('signin[password]' => 'password', 'signin[username]' => 'user', 'signin[_csrf_token]' => '7bd809388ed8bf763fc5fccc255d042e'))-> with('response')->begin()-> checkelement('h2', 'welcome humans')-> end()
thank you
yes, have sign in carry out tests. fortunately, simpler method illustrate above. see "better , simpler way" on blog post.
you make signin
method part of testfunctional
class according how you've structured tests.
Comments
Post a Comment