add POD to PseudoRequest. Needs more
This commit is contained in:
parent
ab476b36e5
commit
23f86d775e
1 changed files with 72 additions and 0 deletions
|
|
@ -2,6 +2,34 @@ package WebGUI::PseudoRequest;
|
|||
|
||||
use strict;
|
||||
|
||||
=head1 LEGAL
|
||||
|
||||
-------------------------------------------------------------------
|
||||
WebGUI is Copyright 2001-2005 Plain Black Corporation.
|
||||
-------------------------------------------------------------------
|
||||
Please read the legal notices (docs/legal.txt) and the license
|
||||
(docs/license.txt) that came with this distribution before using
|
||||
this software.
|
||||
-------------------------------------------------------------------
|
||||
http://www.plainblack.com info@plainblack.com
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=head1 NAME
|
||||
|
||||
Package WebGUI::PseudoRequest
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
This is the most complete imitation of Apache2::Request. You can use this package to
|
||||
create a request object that will work with WebGUI, without actually being inside
|
||||
the mod_perl environment?
|
||||
|
||||
Why in the world would you want to do this? Well, when doing API testing sometimes
|
||||
you run across things that require a request object, but you don't really want to
|
||||
fire up Apache in order to do it. This will let you bypass that.
|
||||
|
||||
=cut
|
||||
|
||||
package WebGUI::PseudoRequest::Headers;
|
||||
|
||||
sub new {
|
||||
|
|
@ -75,6 +103,15 @@ sub size {
|
|||
|
||||
package WebGUI::PseudoRequest;
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
||||
=head2 new
|
||||
|
||||
Construct a new PseudoRequest object. Creates a new Headers object as well and places
|
||||
it inside the PseudoRequest object.
|
||||
|
||||
=cut
|
||||
|
||||
sub new {
|
||||
my $this = shift;
|
||||
my $class = ref($this) || $this;
|
||||
|
|
@ -84,6 +121,14 @@ sub new {
|
|||
return $self;
|
||||
}
|
||||
|
||||
=head2 body ( [$value])
|
||||
|
||||
Compatibility method. Returns the requested form value, $value. If $value isn't passed in, returns
|
||||
all form variables.
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
sub body {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
|
|
@ -109,12 +154,26 @@ sub body {
|
|||
}
|
||||
}
|
||||
|
||||
=head2 setup_body ( $value )
|
||||
|
||||
Setup the object's body method so that it can be used. $value should be a hash ref of named
|
||||
form variables and values.
|
||||
|
||||
=cut
|
||||
|
||||
sub setup_body {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
$self->{body} = $value;
|
||||
}
|
||||
|
||||
=head2 content_type ( [$value] )
|
||||
|
||||
Getter and setter for content_type. If $value is passed in, it will set the content_type of
|
||||
the object to that. Returns the content_type stored in the object.
|
||||
|
||||
=cut
|
||||
|
||||
sub content_type {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
|
|
@ -124,11 +183,24 @@ sub content_type {
|
|||
return $self->{content_type};
|
||||
}
|
||||
|
||||
=head2 headers_out ( )
|
||||
|
||||
Returns the PseudoRequst::Headers object stored in $self for access to the headers.
|
||||
|
||||
=cut
|
||||
|
||||
sub headers_out {
|
||||
my $self = shift;
|
||||
return $self->{headers_out}; ##return object for method chaining
|
||||
}
|
||||
|
||||
=head2 no_cache ( [$value] )
|
||||
|
||||
Getter and setter for no_cache. If $value is passed in, it will set no_cache of
|
||||
the object to that. Returns the no_cache value stored in the object.
|
||||
|
||||
=cut
|
||||
|
||||
sub no_cache {
|
||||
my $self = shift;
|
||||
my $value = shift;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue