perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: modperl-2.0/t/hooks/TestHooks init.pm
Date Sat, 06 Oct 2001 19:44:30 GMT
dougm       01/10/06 12:44:30

  Modified:    t/hooks  .cvsignore
  Added:       t/hooks/TestHooks init.pm
  Log:
  add PerlInitHandler test
  
  Revision  Changes    Path
  1.3       +1 -0      modperl-2.0/t/hooks/.cvsignore
  
  Index: .cvsignore
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/hooks/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore	2001/09/28 15:21:15	1.2
  +++ .cvsignore	2001/10/06 19:44:30	1.3
  @@ -4,3 +4,4 @@
   authz.t
   fixup.t
   trans.t
  +init.t
  
  
  
  1.1                  modperl-2.0/t/hooks/TestHooks/init.pm
  
  Index: init.pm
  ===================================================================
  package TestHooks::init;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  
  sub first {
      my $r = shift;
  
      $r->notes->set(ok1 => 1);
  
      Apache::OK;
  }
  
  sub second {
      my $r = shift;
  
      my $ok = $r->notes->get('ok1') || 0;
  
      $r->notes->set(ok2 => $ok + 1);
  
      Apache::OK;
  }
  
  sub handler {
      my $r = shift;
  
      my $ok = $r->notes->get('ok2') || 0;
  
      $r->notes->set(ok3 => $ok + 1);
  
      Apache::OK;
  }
  
  sub response {
      my $r = shift;
  
      my $tests = 3;
      plan $r, tests => $tests;
  
      for my $x (1..$tests) {
          my $val = $r->notes->get("ok$x") || 0;
          ok $val == $x;
      }
  
      Apache::OK;
  }
  
  1;
  __DATA__
  PerlInitHandler TestHooks::init::second
  <Base>
      PerlInitHandler TestHooks::init::first
  </Base>
  PerlResponseHandler TestHooks::init::response
  SetHandler modperl
  
  
  

Mime
View raw message