Bugzilla – Attachment 101914 Details for
Bug 23352
Define serial's collection in the subscription
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23352: Changes to unit tests
Bug-23352-Changes-to-unit-tests.patch (text/plain), 6.17 KB, created by
Aleisha Amohia
on 2020-03-26 21:35:43 UTC
(
hide
)
Description:
Bug 23352: Changes to unit tests
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2020-03-26 21:35:43 UTC
Size:
6.17 KB
patch
obsolete
>From 73c8e4068e68a9fd9368b78a338ff689c4e6aa64 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Tue, 13 Aug 2019 13:52:35 +1200 >Subject: [PATCH] Bug 23352: Changes to unit tests > >Changes to t/db_dependent/Serials.t unit tests to capture and >test the changes to NewSubscription() and ModSubscription() in >C4/Serials.pm > >Test plan: >1. Follow test plan in first commit > >2. From Koha home directory enter Koha shell and run: > >prove t/db_dependent/Serials.t > >Sponsored-By: Brimbank Library, Australia >--- > C4/Items.pm | 8 ++++---- > t/db_dependent/Serials.t | 22 ++++++++++++++++------ > 2 files changed, 20 insertions(+), 10 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index ec47f29c95..cd7996f21a 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1366,7 +1366,7 @@ sub _SearchItems_build_where_fragment { > > my ($items, $total) = SearchItems($filter, $params); > >-Perform ubscriptionCurrentlyOnOrder search among items >+Perform a search among items > > $filter is a reference to a hash which can be a filter, or a combination of filters. > >@@ -1553,10 +1553,10 @@ sub PrepareItemrecordDisplay { > > #If the subscription is on order (i.e. aqorders.datereceived is NULL then call GetLastOrderNotReceviedFromSubscription() which > #retrieves the last order for the subscriptionid with a datereceived also equalling NULL >- if ( subscriptionCurrentlyOnOrder($subscriptionid) ) { >- $lastOrder = GetLastOrderNotReceivedFromSubscriptionid( $subscriptionid ); >+ if ( C4::Serials::subscriptionCurrentlyOnOrder($subscriptionid)) { >+ $lastOrder = C4::Acquisition::GetLastOrderNotReceivedFromSubscriptionid( $subscriptionid ); > } else { #Otherwise the subscription has already arrived so retrieve the last order for the subscriptionid where datereceived is not null >- $lastOrder = GetLastOrderReceivedFromSubscriptionid( $subscriptionid ); >+ $lastOrder = C4::Acquisition::GetLastOrderReceivedFromSubscriptionid( $subscriptionid ); > } > > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >diff --git a/t/db_dependent/Serials.t b/t/db_dependent/Serials.t >index 735af75430..a4f0fa6733 100755 >--- a/t/db_dependent/Serials.t >+++ b/t/db_dependent/Serials.t >@@ -18,7 +18,7 @@ use Koha::DateUtils; > use Koha::Acquisition::Booksellers; > use t::lib::Mocks; > use t::lib::TestBuilder; >-use Test::More tests => 49; >+use Test::More tests => 51; > > BEGIN { > use_ok('C4::Serials'); >@@ -83,15 +83,18 @@ my $subscriptionid = NewSubscription( > undef, undef, undef, undef, undef, undef, > 1, $notes, ,undef, '2013-01-01', undef, $pattern_id, > undef, undef, 0, $internalnotes, 0, >- undef, undef, 0, undef, '2013-12-31', 0 >+ undef, undef, 0, undef, '2013-12-31', 0, >+ undef, undef, undef, 'ccodevalue' > ); > > my $subscriptioninformation = GetSubscription( $subscriptionid ); > > is( $subscriptioninformation->{notes}, $notes, 'NewSubscription should set notes' ); > is( $subscriptioninformation->{internalnotes}, $internalnotes, 'NewSubscription should set internalnotes' ); >+is( $subscriptioninformation->{ccode}, 'ccodevalue', 'NewSubscription ccode should be "ccodevalue"' ); > > my $subscription_history = C4::Serials::GetSubscriptionHistoryFromSubscriptionId($subscriptionid); >+ > is( $subscription_history->{opacnote}, undef, 'NewSubscription should not set subscriptionhistory opacnotes' ); > is( $subscription_history->{librariannote}, undef, 'NewSubscription should not set subscriptionhistory librariannotes' ); > >@@ -117,6 +120,7 @@ if (not $frequency->{unit}) { > $frequency->{description} = "Frequency created by t/db_dependant/Serials.t"; > $subscriptioninformation->{periodicity} = AddSubscriptionFrequency($frequency); > $subscriptioninformation->{serialsadditems} = 1; >+ $subscriptioninformation->{ccode} = 'ccodevalue2'; > > ModSubscription( @$subscriptioninformation{qw( > librarian branchcode aqbooksellerid cost aqbudgetid startdate >@@ -125,12 +129,16 @@ if (not $frequency->{unit}) { > innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes > letter manualhistory internalnotes serialsadditems staffdisplaycount > opacdisplaycount graceperiod location enddate subscriptionid >- skip_serialseq >+ skip_serialseq itemtype previousitemtype mana_id ccode > )} ); > } > my $expirationdate = GetExpirationDate($subscriptionid) ; > ok( $expirationdate, "expiration date is not NULL" ); > >+#Check if ccode has changed >+my $subscriptioninformation2 = GetSubscription( $subscriptionid ); >+is( $subscriptioninformation2->{ccode}, 'ccodevalue2', 'ModifiedSubscription ccode should be "ccodevalue2"' ); >+ > ok(C4::Serials::GetSubscriptionHistoryFromSubscriptionId($subscriptionid), 'test getting history from sub-scription'); > > my ($serials_count, @serials) = GetSerials($subscriptionid); >@@ -183,7 +191,7 @@ if ($old_frequency) { > innerloop2 lastvalue3 innerloop3 status biblionumber callnumber notes > letter manualhistory internalnotes serialsadditems staffdisplaycount > opacdisplaycount graceperiod location enddate subscriptionid >- skip_serialseq >+ skip_serialseq itemtype previousitemtype mana_id ccode > )} ); > > DelSubscriptionFrequency($freq_to_delete); >@@ -296,7 +304,8 @@ $subscriptionid = NewSubscription( > undef, undef, undef, undef, undef, undef, > 1, $notes,undef, '2013-01-01', undef, $pattern_id, > undef, undef, 0, $internalnotes, 0, >- undef, undef, 0, undef, '2013-12-31', 0 >+ undef, undef, 0, undef, '2013-12-31', 0, >+ undef, undef, undef, 'ccode' > ); > my $total_issues; > ( $total_issues, @serials ) = C4::Serials::GetSerials( $subscriptionid ); >@@ -396,7 +405,8 @@ subtest "NewSubscription" => sub { > "", "", "", "", "", "", > 1, $notes,"", '2013-01-01', "", $pattern_id, > "", "", 0, $internalnotes, 0, >- "", "", 0, "", '2013-12-31', 0 >+ "", "", 0, "", '2013-12-31', 0, "", >+ "", "", "ccode" > ); > ok($subscriptionid, "Sending empty string instead of undef to reflect use of the interface"); > }; >-- >2.11.0
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 23352
:
91678
|
91679
|
91901
|
91985
|
91986
|
92149
|
92165
|
92166
|
95662
|
101913
|
101914
|
101916
|
129123
|
129124
|
129125
|
129225
|
129226
|
129227
|
129228
|
131426
|
131427
|
131435
|
131437
|
131438
|
131439
|
132920
|
133679
|
133680
|
133681
|
133682
|
133683
|
133786
|
133787
|
133788
|
133789
|
133790
|
163965