summaryrefslogtreecommitdiff
path: root/t/TestHttpd.pm
diff options
context:
space:
mode:
Diffstat (limited to 't/TestHttpd.pm')
-rw-r--r--t/TestHttpd.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/TestHttpd.pm b/t/TestHttpd.pm
new file mode 100644
index 0000000..44f6b87
--- /dev/null
+++ b/t/TestHttpd.pm
@@ -0,0 +1,25 @@
+package TestHttpd;
+use strict;
+use warnings;
+use lib qw(t lib);
+use parent 'Apache::Defaults';
+use MockHttpd;
+use File::Temp qw(tempfile);
+
+sub new {
+ my $class = shift;
+ local %_ = @_;
+ if (my $env = $_{environ}) {
+ my ($fh, $name) = tempfile();
+ while (my ($k,$v) = each %$env) {
+ $v =~ s/(["\\])/\\$1/g;
+ print $fh "$k=\"$v\"\n";
+ print $fh "export $k\n";
+ }
+ close $fh;
+ $_{environ} = $name;
+ }
+ $class->SUPER::new(server => "$^X ".$INC{'MockHttpd.pm'}, %_);
+}
+
+1;

Return to:

Send suggestions and report system problems to the System administrator.