I know i will post a lot of code within this msg, i'll try to keep it
light as possible :

The only things i test actually is to act as logged user and if the
page /address is correctly loaded (200).

I discover that if i go into setting.yml and change the php error
level, i have kind of success, but not with E_ALL.

indeed, that seem a session issue, someone have any hint on that one ?

test:
  .settings:
    error_reporting:        <?php echo ((E_ALL | E_STRICT) ^
E_NOTICE)."\n" ?>
    cache:                  off
    web_debug:              off
    no_script_name:         off
    etag:                   off

[bun...@bungie site.com]$ symfony test:functional frontend
addressActions
# get /login
# post /login
not ok 1 - page redirected
# Failed test (./lib/vendor/symfony/lib/test/
sfTesterResponse.class.php at line 277)  The request was not
redirected.

not ok 2 - last request threw an uncaught exception RuntimeException:
PHP sent a warning error at /Users/bungie/Sites/site.com/lib/vendor/
symfony/lib/storage/sfSessionStorage.class.php line 171
(session_regenerate_id(): Cannot regenerate session id - headers
already sent)
#     Failed test (./lib/vendor/symfony/lib/test/
sfTestFunctionalBase.class.php at line 526)
1..2
 Looks like you failed 2 tests of 2.


Now if i remove the E_ALL into setting.yml :

test:
  .settings:
    error_reporting:        <?php echo ((E_STRICT) ^ E_NOTICE)."\n" ?>
    cache:                  off
    web_debug:              off
    no_script_name:         off
    etag:                   off

[bun...@bungie site.com]$ symfony test:functional frontend
addressActions
# get /login
# post /login
ok 1 - page redirected to http://localhost/index.php/
# get /address
ok 2 - request parameter module is address
ok 3 - request parameter action is index
ok 4 - status code is 200
1..4
 Looks like everything went fine.


On Jun 25, 5:53 pm, "particul.es" <[email protected]> wrote:
> Yo Sikk,
>
> Not sure, that's the best practice...
>
> -----------
> class myTestBrowser extends sfTestFunctional
> {
>    public function signin($username, $password)
>    {
>        return $this->get('/sfGuardAuth/signin')->
>          setField('signin[username]', $username)->
>          setField('signin[password]', $password)->
>          click('sign in')->
>
>        with('response')->begin()->
>          isRedirected()->
>          followRedirect()->
>        end();
>    }}
>
> ------------
>
> $b = new myTestBrowser(new sfBrowser());
>
> $b->signin('admin', puc')
> ->...
>
> See ya...
>
> Le 25 juin 09 à 22:39, sikk a écrit :
>
>
>
> > hey guys,
>
> > I'm currently trying to put in place some functional testing with
> > symfony 1.2.*
>
> > I can't find the right solution to be able to simulate the user as
> > logged in correctly to be used in many test case.
>
> > Someone got any strategy already implemented and workin ?
>
> > Thanks a lot !
>
> > sikk
--~--~---------~--~----~------------~-------~--~----~
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