| Apache2::ASP::Mock::RequestRec - Mimics the mod_perl2 Apache2::RequestRec object |
Apache2::ASP::Mock::RequestRec - Mimics the mod_perl2 Apache2::RequestRec object ($r)
my $r = Apache2::ASP::HTTPContext->current->r; $r->filename( '/index.asp' ); # '/usr/local/projects/mysite.com/htdocs/index.asp $r->pnotes( foo => 'bar' ); # set foo = 'bar' my $foo = $r->pnotes( 'foo' ); # get foo my $output_buffer_contents = $r->buffer; my $mock_apr_pool = $r->pool; $r->status( '302 Found' ); my $status = $r->status; my $uri = $r->uri; $r->uri('/new.asp'); my $method = $r->method; # get/post $r->content_type( 'text/html' ); my $type = $r->content_type; my $mock_connection = $r->connection; $r->print( 'some string' ); $r->rflush;
This package provides "mock" access to what would normally be an the Apache2::RequestRec manpage object -
known by the name $r in a normal mod_perl2 environment.
This package exists only to provide a layer of abstraction for the Apache2::ASP::API manpage and the Apache2::ASP::Test::Base manpage.
NOTE: The purpose of this package is only to mimic enough of the functionality of the Apache2::RequestRec manpage to get by without it - specifically during testing.
If you require additional functionality, patches are welcome!
Read-only. Returns the absolute filename for the current request - i.e. /usr/local/projects/mysite.com/htdocs/index.asp
Read/Write. Set or get a variable for the duration of the current request.
Read-only. Returns the contents of the current output buffer.
Read-only. Returns the current the Apache2::ASP::Mock::Pool manpage object.
Read/Write. Set or get the HTTP status code, a la the Apache2::Const manpage.
Read/Write. Set or get the request URI.
Read-only. Gets the request method - i.e. 'get' or 'post'.
Read/Write. Set or get the outgoing content-type header.
Read-only. Returns the current the Apache2::ASP::Mock::Connection manpage object.
Adds $string to the output buffer.
Does nothing. Here only to maintain compatibility with a normal mod_perl2 environment.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago <jdrago_999@yahoo.com>
Copyright 2008 John Drago. All rights reserved.
This software is Free software and is licensed under the same terms as perl itself.
| Apache2::ASP::Mock::RequestRec - Mimics the mod_perl2 Apache2::RequestRec object |