[Catalyst] setting/getting session data from within tests

Daniel McBrearty danielmcbrearty at gmail.com
Mon Jun 5 16:08:57 CEST 2006


Thanks. That's what I suspected, but you can always ask.

basically, any app where you have some logic deciding what page to
serve, depending on session state, gets tricky to test.

I might try the $c approach, but I haven't figured out how yet.


On 6/5/06, Yuval Kogman <nothingmuch at woobling.org> wrote:
> On Mon, Jun 05, 2006 at 11:56:52 +0200, Daniel McBrearty wrote:
> > thanks Yuval.
> >
> > from what I can see though, you are just doing get_ok,
> > content_contains, content_like here .. I don't see where you are
> > actually manipulating the session data in the test itself, which is
> > what I'm hoping for (dunno if it is actually doable yet ... )
>
> Oh, you can't really...
>
> The session exists only in the duration of the request cycle.
>
> You need to write code that will do that stuff in some kind of
> controller, and then query that. These requests should use the
> session and return data the represents the test results.
>
>
> Another, totally different approach is to mock $c and hand it over
> to your actions, making sure they do the right thing.
>
> --
>   Yuval Kogman <nothingmuch at woobling.org>
> http://nothingmuch.woobling.org  0xEBD27418
>
>
>
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst
>
>
>
>


-- 
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131



More information about the Catalyst mailing list