From f0aef5e044af06d116b97def4a5e0e9438ebe4e9 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Wed, 30 Oct 2013 02:27:20 +0000 Subject: [PATCH] Bug 7688: (follow-up) update test cases to reflect change in NewSubscription() This patch also corrects an error in the description of NewSubscription(). Named parameters for this function cannot come soon enough. Signed-off-by: Galen Charlton --- C4/Serials.pm | 2 +- .../Acquisition/OrderFromSubscription.t | 12 ++-- t/db_dependent/Bookseller.t | 62 +++++++------------ 3 files changed, 30 insertions(+), 46 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index c692dda61f..86f3c0b6f5 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1459,7 +1459,7 @@ sub ModSubscription { =head2 NewSubscription $subscriptionid = &NewSubscription($auser,branchcode,$aqbooksellerid,$cost,$aqbudgetid,$biblionumber, - $startdate,$periodicity,$dow,$numberlength,$weeklength,$monthlength, + $startdate,$periodicity,$numberlength,$weeklength,$monthlength, $lastvalue1,$innerloop1,$lastvalue2,$innerloop2,$lastvalue3,$innerloop3, $status, $notes, $letter, $firstacquidate, $irregularity, $numberpattern, $callnumber, $hemisphere, $manualhistory, $internalnotes, $serialsadditems, diff --git a/t/db_dependent/Acquisition/OrderFromSubscription.t b/t/db_dependent/Acquisition/OrderFromSubscription.t index 847d497006..60b1d3a03d 100644 --- a/t/db_dependent/Acquisition/OrderFromSubscription.t +++ b/t/db_dependent/Acquisition/OrderFromSubscription.t @@ -44,12 +44,12 @@ my $budget_id = AddBudget({ }); my $subscriptionid = NewSubscription( - undef, "", undef, undef, $budget_id, $biblionumber, '01-01-2013',undef, - undef, undef, undef, undef, undef, undef, undef, undef, - undef, undef, undef, undef, undef, undef, undef, undef, - undef, undef, undef, undef, undef, undef, undef, 1, - "notes", undef, undef, undef, undef, undef, undef, 0, - "intnotes", 0, undef, undef, 0, undef, '31-12-2013', + undef, "", undef, undef, $budget_id, $biblionumber, + '01-01-2013',undef, undef, undef, undef, + undef, undef, undef, undef, undef, undef, + 1, "notes",undef, '01-01-2013', undef, undef, + undef, undef, 0, "intnotes", 0, + undef, undef, 0, undef, '31-12-2013', 0 ); die unless $subscriptionid; diff --git a/t/db_dependent/Bookseller.t b/t/db_dependent/Bookseller.t index 4415144312..2dc79e38f8 100644 --- a/t/db_dependent/Bookseller.t +++ b/t/db_dependent/Bookseller.t @@ -190,38 +190,28 @@ my ($biblionumber, $biblioitemnumber) = AddBiblio($bib, ''); $bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1); is( $bookseller1fromid->{subscriptioncount}, 0, 'Supplier1 has 0 subscription' ); -my $id_subscription1 = C4::Serials::NewSubscription( - undef, "", $id_supplier1, undef, - $id_budget, $biblionumber, '01-01-2013', undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, 1, - "subscription notes", undef, undef, undef, - undef, undef, undef, 0, - "intnotes", 0, undef, undef, - 0, undef, '31-12-2013', + +my $id_subscription1 = NewSubscription( + undef, "", $id_supplier1, undef, $id_budget, $biblionumber, + '01-01-2013',undef, undef, undef, undef, + undef, undef, undef, undef, undef, undef, + 1, "subscription notes",undef, '01-01-2013', undef, undef, + undef, undef, 0, "intnotes", 0, + undef, undef, 0, undef, '31-12-2013', 0 ); my @subscriptions = SearchSubscriptions({biblionumber => $biblionumber}); is($subscriptions[0]->{publicnotes}, 'subscription notes', 'subscription search results include public notes (bug 10689)'); -my $id_subscription2 = C4::Serials::NewSubscription( - undef, "", $id_supplier1, undef, - $id_budget, $biblionumber, '01-01-2013', undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, 1, - "subscription notes", undef, undef, undef, - undef, undef, undef, 0, - "intnotes", 0, undef, undef, - 0, undef, '31-12-2013', +my $id_subscription2 = NewSubscription( + undef, "", $id_supplier1, undef, $id_budget, $biblionumber, + '01-01-2013',undef, undef, undef, undef, + undef, undef, undef, undef, undef, undef, + 1, "subscription notes",undef, '01-01-2013', undef, undef, + undef, undef, 0, "intnotes", 0, + undef, undef, 0, undef, '31-12-2013', 0 ); + $bookseller1fromid = C4::Bookseller::GetBookSellerFromId($id_supplier1); is( $bookseller1fromid->{subscriptioncount}, 2, 'Supplier1 has 2 subscriptions' ); @@ -371,19 +361,13 @@ ModBasket($basket3info); ModBasket($basket4info); #Add 1 subscription -my $id_subscription3 = C4::Serials::NewSubscription( - undef, "", $id_supplier3, undef, - $id_budget, $biblionumber, '01-01-2013', undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, undef, - undef, undef, undef, 1, - "notes", undef, undef, undef, - undef, undef, undef, 0, - "intnotes", 0, undef, undef, - 0, undef, '31-12-2013', +my $id_subscription3 = NewSubscription( + undef, "", $id_supplier1, undef, $id_budget, $biblionumber, + '01-01-2013',undef, undef, undef, undef, + undef, undef, undef, undef, undef, undef, + 1, "subscription notes",undef, '01-01-2013', undef, undef, + undef, undef, 0, "intnotes", 0, + undef, undef, 0, undef, '31-12-2013', 0 ); #Add 4 orders -- 2.39.5