From c17d9aa394e01d7c4941d73af122c632fd006ea7 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Thu, 29 Sep 2011 14:39:52 -0700 Subject: [PATCH] Allow PseudoRequest to handle 0 and '' correctly. Kudos to knowmad for pointing this behavior out. --- t/Asset/EMSSubmissionForm.t | 4 ++-- t/lib/WebGUI/PseudoRequest.pm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/t/Asset/EMSSubmissionForm.t b/t/Asset/EMSSubmissionForm.t index ada3f14ad..4a4847b40 100644 --- a/t/Asset/EMSSubmissionForm.t +++ b/t/Asset/EMSSubmissionForm.t @@ -432,10 +432,10 @@ my $expected = { }, 'description' => undef, '_isValid' => 1, - 'deleteCreatedItems' => undef, + 'deleteCreatedItems' => 0, 'canSubmitGroupId' => '2', 'assetId' => 'new', - 'url' => undef, + 'url' => '', 'daysBeforeCleanup' => '7', 'title' => 'Untitled', } ; diff --git a/t/lib/WebGUI/PseudoRequest.pm b/t/lib/WebGUI/PseudoRequest.pm index c1f293c70..2526ff2c5 100644 --- a/t/lib/WebGUI/PseudoRequest.pm +++ b/t/lib/WebGUI/PseudoRequest.pm @@ -87,7 +87,7 @@ sub body { return keys %{ $self->{body} } if wantarray; return { %{ $self->{body} } }; } - if ($self->{body}->{$value}) { + if (defined $self->{body}->{$value}) { if (wantarray && ref $self->{body}->{$value} eq "ARRAY") { return @{$self->{body}->{$value}}; }