Bugzilla – Attachment 43522 Details for
Bug 12933
Add ability to print overdue slip from staff intranet
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12933 [QA Followup] - Add Unit Tests
Bug-12933-QA-Followup---Add-Unit-Tests.patch (text/plain), 2.56 KB, created by
Kyle M Hall (khall)
on 2015-10-16 14:36:26 UTC
(
hide
)
Description:
Bug 12933 [QA Followup] - Add Unit Tests
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-10-16 14:36:26 UTC
Size:
2.56 KB
patch
obsolete
>From 5b3f8b29134957fa329ffaafa8af9b249e1b4851 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 1 Jan 2015 19:18:18 -0500 >Subject: [PATCH] Bug 12933 [QA Followup] - Add Unit Tests > >--- > t/db_dependent/Members/GetOverdues.t | 64 ++++++++++++++++++++++++++++++++++ > 1 files changed, 64 insertions(+), 0 deletions(-) > create mode 100644 t/db_dependent/Members/GetOverdues.t > >diff --git a/t/db_dependent/Members/GetOverdues.t b/t/db_dependent/Members/GetOverdues.t >new file mode 100644 >index 0000000..d779967 >--- /dev/null >+++ b/t/db_dependent/Members/GetOverdues.t >@@ -0,0 +1,64 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+ >+use Test::More tests => 3; >+use Test::MockModule; >+ >+use C4::Biblio; >+use C4::Items; >+use C4::Members; >+use C4::Branch; >+use C4::Category; >+use C4::Circulation; >+use MARC::Record; >+ >+my $dbh = C4::Context->dbh; >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ >+$dbh->do(q|DELETE FROM issues|); >+$dbh->do(q|DELETE FROM borrowers|); >+$dbh->do(q|DELETE FROM items|); >+$dbh->do(q|DELETE FROM branches|); >+$dbh->do(q|DELETE FROM biblio|); >+$dbh->do(q|DELETE FROM categories|); >+ >+my $branchcode = 'B'; >+ModBranch( { add => 1, branchcode => $branchcode, branchname => 'Branch' } ); >+ >+my $categorycode = 'C'; >+$dbh->do( "INSERT INTO categories(categorycode) VALUES(?)", >+ undef, $categorycode ); >+ >+my %item_branch_infos = ( >+ homebranch => $branchcode, >+ holdingbranch => $branchcode, >+); >+ >+my ($biblionumber1) = AddBiblio( MARC::Record->new, '' ); >+my $itemnumber1 = >+ AddItem( { barcode => '0101', %item_branch_infos }, $biblionumber1 ); >+my $itemnumber2 = >+ AddItem( { barcode => '0102', %item_branch_infos }, $biblionumber1 ); >+ >+my ($biblionumber2) = AddBiblio( MARC::Record->new, '' ); >+my $itemnumber3 = >+ AddItem( { barcode => '0103', %item_branch_infos }, $biblionumber2 ); >+ >+my $borrowernumber = >+ AddMember( categorycode => $categorycode, branchcode => $branchcode ); >+my $borrower = GetMember( borrowernumber => $borrowernumber ); >+ >+my $module = new Test::MockModule('C4::Context'); >+$module->mock( 'userenv', sub { { branch => $branchcode } } ); >+ >+AddIssue( $borrower, '0101', DateTime->now->subtract( days => 1 ) ); >+AddIssue( $borrower, '0102', DateTime->now->subtract( days => 5 ) ); >+AddIssue( $borrower, '0103' ); >+ >+my $overdues = C4::Members::GetOverdues( $borrowernumber ); >+is( @$overdues, 2, 'GetOverdues returns the correct number of elements' ); >+is( $overdues->[0]->{itemnumber}, $itemnumber1, 'First overdue is correct' ); >+is( $overdues->[1]->{itemnumber}, $itemnumber2, 'Second overdue is correct' ); >+ >-- >1.7.2.5
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 12933
:
31638
|
31667
|
34456
|
34457
|
34467
|
34468
|
34469
|
34470
|
34471
|
34474
|
34475
|
34884
|
34885
|
34886
|
34887
|
34888
|
34889
|
35533
|
35534
|
35535
|
35536
|
35537
|
35538
|
35918
|
41606
|
41607
|
41608
|
41609
|
41610
|
41611
|
43514
|
43515
|
43516
|
43517
|
43518
|
43519
|
43520
|
43521
|
43522
|
43523
|
43904
|
43905
|
43906
|
43907
|
43908
|
43925
|
43926
|
43927
|
43928
|
43929
|
43930
|
43953