perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin redirect.pl
Date Fri, 16 Aug 2002 10:11:17 GMT
stas        2002/08/16 03:11:17

  Added:       ModPerl-Registry/t redirect.t
               ModPerl-Registry/t/cgi-bin redirect.pl
  Log:
  test external redirects
  
  Revision  Changes    Path
  1.1                  modperl-2.0/ModPerl-Registry/t/redirect.t
  
  Index: redirect.t
  ===================================================================
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest qw(GET_BODY HEAD);
  
  plan tests => 2;
  
  my $base_url = "/registry/redirect.pl";
  
  {
      my $redirect_path = "/registry/basic.pl";
      my $url = "$base_url?$redirect_path";
  
      ok t_cmp(
          "ok",
          GET_BODY($url),
          "test redirect: existing target",
         );
  }
  
  {
      my $redirect_path = "/registry/does_not_exists.pl";
      my $url = "$base_url?$redirect_path";
  
      ok t_cmp(
          404,
          HEAD($url)->code,
          "test redirect: non-existing target",
         );
  }
  
  
  
  1.1                  modperl-2.0/ModPerl-Registry/t/cgi-bin/redirect.pl
  
  Index: redirect.pl
  ===================================================================
  # test env vars
  
  use Apache::URI ();
  
  my $r = shift;
  my $path = $r->args || '';
  $server = $r->construct_server;
  
  print "Location: http://$server$path\n\n";
  warn "Location: http://$server$path\n\n";
  
  __END__
  
  
  

Mime
View raw message