This is an old version of this question!
Return to the current question
$5
Can not signin in my functional tests
I've tried every variation I can think on all of the tutorials I've read, and I still can not get this to work.
I'm using Symfony 1.4.
I thought this bit from Sandbox Web Solutions would work for me, but perhaps it is for an older version of Symfony.
Here is what I have right now:
I do not get an outright failure, but I do get a warning, which I do not want:
I did put this in my lib folder:
Any thoughts on what causes this warning?
I'm using Symfony 1.4.
I thought this bit from Sandbox Web Solutions would work for me, but perhaps it is for an older version of Symfony.
Here is what I have right now:
include(dirname(__FILE__).'/../../bootstrap/functional.php');
$username = 'xxx';
$password = 'xxx';
$browser = new sfGuardTestFunctional(new sfBrowser());
$browser->
get('/restaurant_award/index')->
signin($username, $password)->
get('/restaurant_award/index')->
with('response')->begin()->
isStatusCode(200)->
end()
;
$browser->
get('/restaurant_award/index')->
with('request')->begin()->
isParameter('module', 'restaurant_award')->
isParameter('action', 'index')->
end()->
with('response')->begin()->
checkElement('body', '!/This is a temporary page/')->
end()
;
I do not get an outright failure, but I do get a warning, which I do not want:
PHP sent a "warning" error at /home/lkrubner/dev/tastingnotes/lib/vendor/symfony/lib/test/sfTestFunctionalBase.class.php line 433 (call_user_func_array(): First argument is expected to be a valid callback, 'sfBrowser::isRedirected' was given) I did put this in my lib folder:
<?php
class sfGuardTestFunctional extends sfTestFunctional {
public function signin($username, $password) {
return $this->
info(sprintf('Signin user using username "%s" and password "%s"', $username, $password))->
post('/sfGuardAuth/signin', array('signin' => array('username' => $username, 'password' => $password,)))->
isRedirected()
;
}
}
Any thoughts on what causes this warning?
Lawrence Krubner | 03/16/11 at 5:02pm
