in reply to Re: Where can I buy an $r with which to test Apache2::Cookie?
in thread Where can I buy an $r with which to test Apache2::Cookie?

Thanks. That's what I feared, and I have heard of (and seen in action, with mixed results) Apache::Test, for which there is probably now an Apache2::Test... but I must say I still don't think that's a reasonable prerequisite for testing cookie generation.

For testing cookie dispatch to the server, maybe... but for testing the generation per se, nope. At this point I'm hoping I can get it working with Test::MockObject.

So I suppose if your warning applies to all Apache2:: classes then I'm going to waste some time, and if it just applies to the RequestRec then I'm golden.

  • Comment on Re^2: Where can I buy an $r with which to test Apache2::Cookie?

Replies are listed 'Best First'.
Re^3: Where can I buy an $r with which to test Apache2::Cookie?
by perrin (Chancellor) on Feb 11, 2008 at 16:50 UTC
    It's not going to work. Apache2::Cookie and the rest of libapreq are a perl interface to a C data structure provided by apache. It's like trying to test your database without running a database.

    If you're determined to test apache without apache, the best you can do is make a mock object of Apache2::Cookie and test that you sent it the right data.

      Oddly, I think it's working fine with the solution in my last comment.

      I'm determined to test, without apache2, the parts of Apache2::* code that shouldn't need apache2, at least for my private values of $shouldn_t.

      But even if I succeed with ::Cookie, I may well fail elsewhere, and so will keep your warning in mind.