You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by do...@apache.org on 2002/05/18 04:07:42 UTC

cvs commit: modperl-2.0/t/response/TestModperl method.pm methodname.pm methodobj.pm

dougm       02/05/17 19:07:42

  Added:       t/response/TestModperl method.pm methodname.pm methodobj.pm
  Log:
  add some test for method handlers
  
  Revision  Changes    Path
  1.1                  modperl-2.0/t/response/TestModperl/method.pm
  
  Index: method.pm
  ===================================================================
  package TestModperl::method;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::Const -compile => 'OK';
  
  sub handler : method {
      my($class, $r) = @_;
  
      plan $r, tests => 3;
  
      ok t_cmp(2, scalar @_,
               '@_ == 2');
  
      my $cmp_class = ref($class) || $class;
  
      ok t_cmp($cmp_class, $cmp_class,
               'handler class');
  
      ok t_cmp('/' . $cmp_class, $r->uri,
               '$r->uri eq __PACKAGE__');
  
      Apache::OK;
  }
  
  1;
  __END__
  
  
  
  1.1                  modperl-2.0/t/response/TestModperl/methodname.pm
  
  Index: methodname.pm
  ===================================================================
  package TestModperl::methodname;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::Const -compile => 'OK';
  
  use TestModperl::method ();
  
  sub response : method {
      TestModperl::method::handler(@_);
  }
  
  1;
  __END__
  PerlResponseHandler TestModperl::methodname->response
  
  
  
  1.1                  modperl-2.0/t/response/TestModperl/methodobj.pm
  
  Index: methodobj.pm
  ===================================================================
  package TestModperl::methodobj;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Const -compile => 'OK';
  
  use TestModperl::method ();
  
  our @ISA = qw(TestModperl::method);
  
  1;
  __END__
  PerlResponseHandler $TestModperl::MethodObj->handler