Apache2-ASP

 view release on metacpan or  search on metacpan

lib/Apache2/ASP/GlobalASA.pm  view on Meta::CPAN


Called after any/all L<Apache2::ASP::RequestFilter>s have finished.

This event won't get used much anymore, since we have L<Apache2::ASP::RequestFilter>s now,
but we keep it around just in case you want it for something quick.

=head2 Script_OnEnd

Called after the script has ended, B<before> any C<PerlCleanupHandler>s are called.

B<NOTE>: This event is not raised if an error is thrown while executing the request.

=head1 BUGS

It's possible that some bugs have found their way into this release.

Use RT L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Apache2-ASP> to submit bug reports.

=head1 HOMEPAGE

Please visit the Apache2::ASP homepage at L<http://www.devstack.com/> to see examples

t/010-coverage/040-httpcontext.t  view on Meta::CPAN



# HandlerResolver that fails:
{
  local $api->config->web->{handler_resolver} = 'My::BadHandlerResolver';
  
  local $SIG{__WARN__} = sub { };
  $api->ua->get( '/index.asp' );
  like $api->context->server->GetLastError,
    qr/TEST ERROR/,
    'Bad resolver throws error';
}


# DoDisableSessionState on a location equals:
{
  local $api->config->web->{disable_persistence}->{location} = [
    Apache2::ASP::ConfigNode->new({
      uri_equals => '/index.asp',
      uri_match => undef,
      disable_session => 1,

t/010-coverage/070-response.t  view on Meta::CPAN

  };
  ok( $@, 'respons.redirect again threw exception' );
  like $@,
        qr/Response\.Redirect cannot be called after headers have been sent/,
        'exception looks right';
}


# Include after the request ended:
{
  # Should NOT throw exception:
  eval {
    $api->context->response->Include( $api->context->server->MapPath('/inc.asp' ) );
  };
  ok( ! $@, 'no exception thrown' );
}


# TrapInclude(1):
{
  # Should NOT throw exception:
  eval {
    $api->context->response->TrapInclude( $api->context->server->MapPath('/inc.asp' ) );
  };
  ok( ! $@, 'no exception thrown' );
}


# TrapInclude(2):
{
  local $api->context->{did_end};
  ok(
    my $res = $api->context->response->TrapInclude( $api->context->server->MapPath('/inc.asp' ) ),
    'got response.trapinclude content'
  );



( run in 0.716 second using v1.01-cache-2.11-cpan-496ff517765 )