09 Apr 2010 17:27:49 UTC
- Distribution: Apache2-FakeRequest
- Module version: 0.04
- Source (raw)
- Browse (raw)
- How to Contribute
- Issues (3)
- Testers (1 / 0 / 5)
- KwaliteeBus factor: 0
- 100.00% Coverage
- License: unknown
- Download (4.21KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
Apache2::FakeRequest - fake request object for testing
use Apache2::FakeRequest; my $request = Apache2::FakeRequest->new(method_name => 'value', ...);
Apache2::FakeRequest is used to set up an empty Apache2 request object that can be used for testing. The Apache2::FakeRequest methods just set internal variables of the same name as the method and return the value of the internal variables. Initial values for methods can be specified when the object is created. The print method prints to STDOUT.
Subroutines for Apache2 constants are also defined so that using Apache2::Const while testing works, although the values of the constants are hard-coded rather than extracted from the Apache2 source code.
#!/usr/bin/perl use Apache2::FakeRequest (); use mymodule (); my $request = Apache2::FakeRequest->new('hostname'=>'foobar.com'); mymodule::handler($request);
This was derived from Apache::FakeRequest by Doug MacEachern.
Thanks also goes out to Gary Josack who was instrumental in helping me get this module working, testing, and installing correctly.
<jplatter at cpan.org>
Copyright (C) 2010 by Jeff Platter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
Module Install Instructions
To install Apache2::FakeRequest, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Apache2::FakeRequest
For more information on module installation, please visit the detailed CPAN module installation guide.
|s||Focus search bar|
|?||Bring up this help dialog|
|g p||Go to pull requests|
|g i||go to github issues (only if github is preferred repository)|
|g a||Go to author|
|g c||Go to changes|
|g i||Go to issues|
|g d||Go to dist|
|g r||Go to repository/SCM|
|g s||Go to source|
|g b||Go to file browse|