Apache-Test

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

attempts to run the test suite under an automated harness (such as a cpan 
smoke test).  Issue reported by CORION and ANDK, PR: 12911
[Fred Moyer <phred@apache.org>]

Use need_module('mod_cgi.c') and need_module('mod_cgid.c') in 
t/next_available_port.t instead of need_cgi.  On case insensitive file
systems such as OS X, need_cgi will fulfill the requirement with cgi.pm,
when mod_cgi.c is the desired requirement.
[Fred Moyer <phred@apache.org>]

Fix overridden get_basic_credentials test when using NTLM authentication
[Rick Frankel <cpan@rickster.com>]

Work around a bug introduced in libwww-perl in version
5.820 for httpd's credentials
[Gunnar Wolf <gwolf@gwolf.org>, Niko Tyni <ntyni@debian.org>]

Make Apache::TestConfig::untaint_path tolerate undefined arguments
[Torsten Foertsch <torsten.foertsch@gmx.net]

Inherit LoadFile directives from the global httpd.conf
[Torsten Foertsch <torsten.foertsch@gmx.net]

Don't overwrite php.ini if it already exists
PR: 32994

README  view on Meta::CPAN


GET url
% t/TEST -get /server-info

HEAD url
% t/TEST -head /server-info

HEAD (no url defaults to /)
% t/TEST -head

GET url with authentication credentials
% t/TEST -get /server-info -username dougm -password foo

POST url (read content from string)
% t/TEST -post /TestApache::post -content 'name=dougm&company=covalent'

POST url (read content from stdin)
% t/TEST -post /TestApache::post -content - < foo.txt

POST url (generate a body of data 1024 bytes in length)
% t/TEST -post /TestApache::post -content x1024

lib/Apache/TestRequest.pm  view on Meta::CPAN

        return $self->SUPER::redirect_ok(@_);
    }

    # No LWP. We don't support redirect on POST.
    return 0 if $self->method eq 'POST';
    # Return user setting or our internal calculation.
    return $RedirectOK if defined $RedirectOK;
    return $REDIR;
}

my %credentials;

#subclass LWP::UserAgent
sub new {
    my $self = shift->SUPER::new(@_);

    lwp_debug(); #init from %ENV (set by Apache::TestRun)

    my $config = Apache::Test::config();
    if (my $proxy = $config->configure_proxy) {
        #t/TEST -proxy
        $self->proxy(http => "http://$proxy");
    }

    $self->timeout(UA_TIMEOUT);

    $self;
}

sub credentials {
    my $self = shift;
    return $self->get_basic_credentials(@_);
}

sub get_basic_credentials {
    my($self, $realm, $uri, $proxy) = @_;

    for ($realm, '__ALL__') {
        next unless $_ && $credentials{$_};
        return @{ $credentials{$_} };
    }

    return (undef,undef);
}

sub vhost_socket {
    my $module = shift;
    local $Apache::TestRequest::Module = $module if $module;

    my $hostport = hostport(Apache::Test::config());

lib/Apache/TestRequest.pm  view on Meta::CPAN

    if ($have_lwp) {
        user_agent();
        $url = resolve_url($url);
    }
    else {
        lwp_debug() if $ENV{APACHE_TEST_DEBUG_LWP};
    }

    my($pass, $keep) = Apache::TestConfig::filter_args(\@_, \%wanted_args);

    %credentials = ();
    if (defined $keep->{username}) {
        $credentials{$keep->{realm} || '__ALL__'} =
          [$keep->{username}, $keep->{password}];
    }
    if (defined(my $content = $keep->{content})) {
        if ($content eq '-') {
            $content = join '', <STDIN>;
        }
        elsif ($content =~ /^x(\d+)$/) {
            $content = 'a' x $1;
        }
        push @$pass, content => $content;



( run in 0.276 second using v1.01-cache-2.11-cpan-4d50c553e7e )