Hello,

I use Apache::FakeRequest to test perl handlers without firing up Apache.
Testting is supposed to be done by matching output of handlers with some
regexps.  But the print method of Apache::Request prints to STDOUT, so to
get output I applied following patch to it:

10c10,17
< sub print { shift; CORE::print(@_) }
---
> sub print {
>  my $self = shift;
>
>  if (exists $$self{fr_output}) {
>   $$self{fr_output} .= join ('', @_);
>  } else { CORE::print(@_) }
>
> }

Now, if fr_output "method" is defined all output comes there.

my $request = Apache::FakeRequest->new(fr_output => '', ...);

If it's "right thing" may be this patch should go to CPAN, and if it's not
"right", I'll be glad to hear how to do it right.

Thanks.

aa29

Reply via email to