Bugzilla – Attachment 31441 Details for
Bug 12876
Reserve in waiting/transfer status may be cancelled by user
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12876: Improve unit tests for CanReserveBeCanceledFromOpac
PASSED-QA-Bug-12876-Improve-unit-tests-for-CanRese.patch (text/plain), 2.09 KB, created by
Katrin Fischer
on 2014-09-07 21:44:12 UTC
(
hide
)
Description:
[PASSED QA] Bug 12876: Improve unit tests for CanReserveBeCanceledFromOpac
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2014-09-07 21:44:12 UTC
Size:
2.09 KB
patch
obsolete
>From 57e4474e82ae560e7d497663d6805da5775b6f68 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 5 Sep 2014 17:40:05 +0200 >Subject: [PATCH] [PASSED QA] Bug 12876: Improve unit tests for > CanReserveBeCanceledFromOpac > >This patch fix the subroutine name and add a restriction on the >arguments: both argument are mandatory! > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> >--- > C4/Reserves.pm | 1 + > t/db_dependent/Reserves.t | 16 +++++++++++++++- > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 7ac54fe..838885c 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -572,6 +572,7 @@ sub CanItemBeReserved{ > sub CanReserveBeCanceledFromOpac { > my ($reserve_id, $borrowernumber) = @_; > >+ return unless $reserve_id and $borrowernumber; > my $reserve = GetReserve($reserve_id); > > return 0 unless $reserve->{borrowernumber} == $borrowernumber; >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index ed7e31e..707d57b 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -2,7 +2,7 @@ > > use Modern::Perl; > >-use Test::More tests => 39; >+use Test::More tests => 42; > > use MARC::Record; > use DateTime::Duration; >@@ -402,6 +402,20 @@ AddReserve('CPL', $requesters{'CPL'}, $item_bibnum, > $title, $checkitem, ''); > my (undef, $canres, undef) = CheckReserves($itemnumber); > >+is( CanReserveBeCanceledFromOpac(), undef, >+ 'CanReserveBeCanceledFromOpac should return undef if called without any parameter' >+); >+is( >+ CanReserveBeCanceledFromOpac( $canres->{resserve_id} ), >+ undef, >+ 'CanReserveBeCanceledFromOpac should return undef if called without the reserve_id' >+); >+is( >+ CanReserveBeCanceledFromOpac( undef, $requesters{CPL} ), >+ undef, >+ 'CanReserveBeCanceledFromOpac should return undef if called without borrowernumber' >+); >+ > my $cancancel = CanReserveBeCanceledFromOpac($canres->{reserve_id}, $requesters{'CPL'}); > is($cancancel, 1, 'Can user cancel its own reserve'); > >-- >1.9.1
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 12876
:
31393
|
31404
|
31406
|
31413
|
31414
|
31440
| 31441 |
31846