Bugzilla – Attachment 63682 Details for
Bug 18664
IssueSlip.t is failing - IssueSlip should return if params are not valid
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 18664: Make IssueSlip returns if params are not valid
SIGNED-OFF-Bug-18664-Make-IssueSlip-returns-if-par.patch (text/plain), 2.12 KB, created by
Josef Moravec
on 2017-05-24 06:02:16 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 18664: Make IssueSlip returns if params are not valid
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2017-05-24 06:02:16 UTC
Size:
2.12 KB
patch
obsolete
>From bf64feb65a97d5c18e7d6a20de46844a0b6401d7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 23 May 2017 16:33:17 -0300 >Subject: [PATCH] [SIGNED-OFF] Bug 18664: Make IssueSlip returns if params are > not valid > >Problem raised by bug 17762: IssueSlip should return if the params are >not valid. >The tests contain 2 FIXME to highlight this problem already, it's time >to fix them. > >Note that, theoretically, this change may produce software error. Indeed >the caller expecting a hashref (letter) will access the "content" key. >But that should not happen. > >Test plan: >Tests must return green > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> >--- > C4/Members.pm | 1 + > t/db_dependent/Members/IssueSlip.t | 15 ++------------- > 2 files changed, 3 insertions(+), 13 deletions(-) > >diff --git a/C4/Members.pm b/C4/Members.pm >index b61f0b1..6527c79 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1174,6 +1174,7 @@ sub IssueSlip { > #return unless $borrowernumber; > > my $patron = Koha::Patrons->find( $borrowernumber ); >+ return unless $patron; > > my @issues = @{ GetPendingIssues($borrowernumber) }; > >diff --git a/t/db_dependent/Members/IssueSlip.t b/t/db_dependent/Members/IssueSlip.t >index c8135bc..d161602 100644 >--- a/t/db_dependent/Members/IssueSlip.t >+++ b/t/db_dependent/Members/IssueSlip.t >@@ -397,20 +397,9 @@ EOS > }; > > subtest 'bad calls' => sub { >- plan tests => 2; >- AddIssue( $borrower, $barcode1, $today, undef, $yesterday ); >+ plan tests => 1; > my $slip = IssueSlip(); >- isnt( $slip, undef, 'IssueSlip should return if no param passed FIXME, should return undef' ); >- my $empty_slip = <<EOS; >-Checked out: >- >- >-Overdues: >- >-EOS >- >- $slip = IssueSlip(undef, $borrowernumber+1); >- is( $slip->{content}, $empty_slip, 'IssueSlip should not return an empty slip if the borrowernumber passed in param does not exist. But it is what it does for now (FIXME)' ); >+ is( $slip, undef, 'IssueSlip should return if no valid borrowernumber is passed' ); > }; > > $schema->storage->txn_rollback; >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18664
:
63673
|
63682
|
63726