request->body and request->param should be the same in tests

This commit is contained in:
Graham Knop 2008-08-07 22:55:35 +00:00
parent 3d62fa8e69
commit f082e2d14e
6 changed files with 7 additions and 23 deletions

View file

@ -26,6 +26,7 @@ sub auto_check {
}
}
);
$request->mock('param', sub {shift->body(@_)});
$session->{_request} = $request;

View file

@ -310,27 +310,7 @@ Compatibility method. Works exactly like the body method.
sub param {
my $self = shift;
my $value = shift;
return keys %{ $self->{param} } unless defined $value;
if ($self->{param}->{$value}) {
if (wantarray && ref $self->{param}->{$value} eq "ARRAY") {
return @{$self->{param}->{$value}};
}
elsif (ref $self->{param}->{$value} eq "ARRAY") {
return $self->{param}->{$value}->[0];
}
else {
return $self->{param}->{$value};
}
}
else {
if (wantarray) {
return ();
}
else {
return undef;
}
}
$self->body(@_);
}
#----------------------------------------------------------------------------
@ -344,8 +324,7 @@ form variables and values.
sub setup_param {
my $self = shift;
my $value = shift;
$self->{param} = $value;
$self->setup_body(@_);
}
#----------------------------------------------------------------------------