request->body and request->param should be the same in tests
This commit is contained in:
parent
3d62fa8e69
commit
f082e2d14e
6 changed files with 7 additions and 23 deletions
|
|
@ -26,6 +26,7 @@ sub auto_check {
|
|||
}
|
||||
}
|
||||
);
|
||||
$request->mock('param', sub {shift->body(@_)});
|
||||
|
||||
$session->{_request} = $request;
|
||||
|
||||
|
|
|
|||
|
|
@ -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(@_);
|
||||
}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue