Bugzilla – Attachment 20421 Details for
Bug 10719
UT GetUpcomingDueIssues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10719 - UT GetUpcomingDueIssues
Bug-10719---UT-GetUpcomingDueIssues.patch (text/plain), 2.32 KB, created by
Jonathan Druart
on 2013-08-16 15:21:45 UTC
(
hide
)
Description:
Bug 10719 - UT GetUpcomingDueIssues
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-08-16 15:21:45 UTC
Size:
2.32 KB
patch
obsolete
>From 89b8cbd96c7fd7119e0a39ebc0c1217a1aeadbb7 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@gmail.com> >Date: Tue, 13 Aug 2013 10:44:07 -0300 >Subject: [PATCH] Bug 10719 - UT GetUpcomingDueIssues > >Some unit tests related to Bug 9362. > >Regards >To+ > >Sponsored-by: Universidad Nacional de Cordoba > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > >http://bugs.koha-community.org/show_bug.cgi?id=10606 >--- > t/db_dependent/Circulation.t | 40 +++++++++++++++++++++++++++++++++++++++- > 1 file changed, 39 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Circulation.t b/t/db_dependent/Circulation.t >index bf27fb5..483ce84 100755 >--- a/t/db_dependent/Circulation.t >+++ b/t/db_dependent/Circulation.t >@@ -9,7 +9,7 @@ use C4::Items; > use C4::Members; > use C4::Reserves; > >-use Test::More tests => 30; >+use Test::More tests => 36; > > BEGIN { > use_ok('C4::Circulation'); >@@ -283,4 +283,42 @@ C4::Context->dbh->do("DELETE FROM borrowers WHERE cardnumber = '99999999999'"); > > } > >+{ >+ # GetUpcomingDueIssues tests >+ my $barcode = 'R00000342'; >+ my $barcode2 = 'R00000343'; >+ my $branch = 'MPL'; >+ >+ # Create a borrower >+ my %a_borrower_data = ( >+ firstname => 'Fridolyn', >+ surname => 'SOMERS', >+ categorycode => 'S', >+ branchcode => $branch, >+ ); >+ >+ my $a_borrower_borrowernumber = AddMember(%a_borrower_data); >+ my $a_borrower = GetMember( borrowernumber => $a_borrower_borrowernumber ); >+ >+ my $yesterday = DateTime->today(time_zone => C4::Context->tz())->add( days => -1 ); >+ my $two_days_ahead = DateTime->today(time_zone => C4::Context->tz())->add( days => 2 ); >+ >+ my $datedue = AddIssue( $a_borrower, $barcode, $yesterday ); >+ my $datedue2 = AddIssue( $a_borrower, $barcode2, $two_days_ahead ); >+ >+ diag( "GetUpcomingDueIssues tests" ); >+ >+ for my $i(0..2) { >+ my $upcoming_dues = C4::Circulation::GetUpcomingDueIssues( { days_in_advance => $i } ); >+ is ( scalar( @$upcoming_dues ), 0, "No items due in less than two days ($i days in advance)" ); >+ } >+ >+ for my $i(3..5) { >+ my $upcoming_dues = C4::Circulation::GetUpcomingDueIssues( { days_in_advance => $i } ); >+ is ( scalar( @$upcoming_dues ), 1, >+ "Bug 9362: Only one item due in more than 2 days ($i days in advance)" ); >+ } >+ >+} >+ > $dbh->rollback; >-- >1.7.10.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 10719
:
20305
|
20421
|
20605