Bugzilla – Attachment 35060 Details for
Bug 12648
Link patrons to an order
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[PASSED QA] Bug 12648: Add unit tests for C4::Acquisition::*OrderUsers
PASSED-QA-Bug-12648-Add-unit-tests-for-C4Acquisiti.patch (text/plain), 4.05 KB, created by
Kyle M Hall (khall)
on 2015-01-09 13:21:26 UTC
(
hide
)
Description:
[PASSED QA] Bug 12648: Add unit tests for C4::Acquisition::*OrderUsers
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2015-01-09 13:21:26 UTC
Size:
4.05 KB
patch
obsolete
>From 9d20b2dc9b5daed8b6e1435c6005bc30e241e78d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 24 Jul 2014 13:49:49 +0200 >Subject: [PATCH] [PASSED QA] Bug 12648: Add unit tests for C4::Acquisition::*OrderUsers > >Test plan: >Verify that unit tests pass with > prove t/db_dependent/Acquisition/OrderUsers.t > >Signed-off-by: Paola Rossi <paola.rossi@cineca.it> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > t/db_dependent/Acquisition/OrderUsers.t | 110 +++++++++++++++++++++++++++++++ > 1 files changed, 110 insertions(+), 0 deletions(-) > create mode 100644 t/db_dependent/Acquisition/OrderUsers.t > >diff --git a/t/db_dependent/Acquisition/OrderUsers.t b/t/db_dependent/Acquisition/OrderUsers.t >new file mode 100644 >index 0000000..5c4ff5c >--- /dev/null >+++ b/t/db_dependent/Acquisition/OrderUsers.t >@@ -0,0 +1,110 @@ >+use Modern::Perl; >+use Test::More tests => 3; >+ >+use C4::Acquisition; >+use C4::Biblio; >+use C4::Bookseller qw( GetBookSellerFromId ); >+use C4::Letters; >+ >+use Koha::Acquisition::Order; >+ >+my $dbh = C4::Context->dbh; >+$dbh->{RaiseError} = 1; >+$dbh->{AutoCommit} = 0; >+ >+# Creating some orders >+my $booksellerid = C4::Bookseller::AddBookseller( >+ { >+ name => "my vendor", >+ address1 => "bookseller's address", >+ phone => "0123456", >+ active => 1, >+ } >+); >+ >+my $basketno = NewBasket( $booksellerid, 1 ); >+ >+my $budgetid = C4::Budgets::AddBudget( >+ { >+ budget_code => "budget_code_test_getordersbybib", >+ budget_name => "budget_name_test_getordersbybib", >+ } >+); >+my $budget = C4::Budgets::GetBudget($budgetid); >+ >+my @ordernumbers; >+my ( $biblionumber, $biblioitemnumber ) = C4::Biblio::AddBiblio( MARC::Record->new, '' ); >+ >+my $ordernumber; >+$ordernumber = Koha::Acquisition::Order->new( >+ { >+ basketno => $basketno, >+ quantity => 2, >+ biblionumber => $biblionumber, >+ budget_id => $budgetid, >+ entrydate => '01-01-2014', >+ currency => 'EUR', >+ notes => "This is a note1", >+ gstrate => 0.0500, >+ orderstatus => 1, >+ quantityreceived => 0, >+ rrp => 10, >+ ecost => 10, >+ } >+)->insert->{ordernumber}; >+ >+my $invoiceid = AddInvoice( >+ invoicenumber => 'invoice', >+ booksellerid => $booksellerid, >+ unknown => "unknown" >+); >+ >+my $borrowernumber = C4::Members::AddMember( >+ cardnumber => 'TESTCARD', >+ firstname => 'TESTFN', >+ surname => 'TESTSN', >+ categorycode => 'S', >+ branchcode => 'CPL', >+ dateofbirth => '', >+ dateexpiry => '9999-12-31', >+ userid => 'TESTUSERID' >+); >+ >+my $borrower = C4::Members::GetMemberDetails( $borrowernumber ); >+ >+C4::Acquisition::ModOrderUsers( $ordernumber, $borrowernumber ); >+ >+my $is_added = grep { /^$borrowernumber$/ } C4::Acquisition::GetOrderUsers( $ordernumber ); >+is( $is_added, 1, 'ModOrderUsers should link patrons to an order' ); >+ >+ModReceiveOrder( >+ { >+ biblionumber => $biblionumber, >+ ordernumber => $ordernumber, >+ quantityreceived => 1, >+ cost => 10, >+ ecost => 10, >+ invoiceid => $invoiceid, >+ rrp => 10, >+ budget_id => $budgetid, >+ } >+); >+ >+my $messages = C4::Letters::GetQueuedMessages({ borrowernumber => $borrowernumber }); >+is( scalar( @$messages ), 0, 'The letter has not been sent to message queue on receiving the order, the order is not entire received'); >+ >+ModReceiveOrder( >+ { >+ biblionumber => $biblionumber, >+ ordernumber => $ordernumber, >+ quantityreceived => 1, >+ cost => 10, >+ ecost => 10, >+ invoiceid => $invoiceid, >+ rrp => 10, >+ budget_id => $budgetid, >+ } >+); >+ >+$messages = C4::Letters::GetQueuedMessages({ borrowernumber => $borrowernumber }); >+is( scalar( @$messages ), 1, 'The letter has been sent to message queue on receiving the order'); >-- >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 12648
:
30024
|
30025
|
30026
|
30027
|
30988
|
30989
|
30990
|
30991
|
31273
|
31960
|
31961
|
32230
|
33186
|
33187
|
33188
|
33189
|
33190
|
33191
|
33192
|
33193
|
34224
|
34225
|
34226
|
34227
|
34228
|
34229
|
34230
|
34231
|
34477
|
34487
|
34488
|
34489
|
34490
|
34491
|
34492
|
34493
|
34494
|
34495
|
35056
|
35058
|
35059
|
35060
|
35061
|
35062
|
35063
|
35064
|
35065
|
35066
|
36795
|
36796
|
36797
|
36798
|
36799
|
36800
|
36801
|
36802
|
36803
|
36804
|
36805
|
36807
|
36810
|
36817