Bugzilla – Attachment 101277 Details for
Bug 23463
Move C4::Items CRUD subroutines to Koha::Item
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 23463: Fix tests
Bug-23463-Fix-tests.patch (text/plain), 6.20 KB, created by
Jonathan Druart
on 2020-03-20 15:14:47 UTC
(
hide
)
Description:
Bug 23463: Fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-03-20 15:14:47 UTC
Size:
6.20 KB
patch
obsolete
>From 4d40645ff18046fe6922334402256fce7367022a Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 6 Feb 2020 10:24:04 -0300 >Subject: [PATCH] Bug 23463: Fix tests > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > t/db_dependent/Circulation/Returns.t | 2 +- > t/db_dependent/Holds.t | 62 ++++++++++++++------------- > t/db_dependent/Members/GetAllIssues.t | 4 +- > t/db_dependent/Reserves.t | 2 +- > 4 files changed, 36 insertions(+), 34 deletions(-) > >diff --git a/t/db_dependent/Circulation/Returns.t b/t/db_dependent/Circulation/Returns.t >index 7675939518..f93ff66945 100644 >--- a/t/db_dependent/Circulation/Returns.t >+++ b/t/db_dependent/Circulation/Returns.t >@@ -70,7 +70,7 @@ Koha::CirculationRules->set_rule( > > subtest "AddReturn logging on statistics table (item-level_itypes=1)" => sub { > >- plan tests => 4; >+ plan tests => 3; > > # Set item-level item types > t::lib::Mocks::mock_preference( "item-level_itypes", 1 ); >diff --git a/t/db_dependent/Holds.t b/t/db_dependent/Holds.t >index 61979bb35c..69b2071284 100755 >--- a/t/db_dependent/Holds.t >+++ b/t/db_dependent/Holds.t >@@ -827,25 +827,26 @@ subtest 'CanItemBeReserved / branch_not_in_hold_group' => sub { > > # Create 3 biblios with items > my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype1->itemtype }); >- my ( undef, undef, $itemnumber_1 ) = AddItem( >- { homebranch => $library1->branchcode, >- holdingbranch => $library1->branchcode >- }, >- $biblio_1->biblionumber >+ my $item_1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_1->biblionumber, >+ library => $library1->branchcode >+ } > ); > my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype2->itemtype }); >- my ( undef, undef, $itemnumber_2 ) = AddItem( >- { homebranch => $library2->branchcode, >- holdingbranch => $library2->branchcode >- }, >- $biblio_2->biblionumber >+ my $item_2 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_2->biblionumber, >+ library => $library2->branchcode >+ } > ); >+ my $itemnumber_2 = $item_2->itemnumber; > my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype1->itemtype }); >- my ( undef, undef, $itemnumber_3 ) = AddItem( >- { homebranch => $library1->branchcode, >- holdingbranch => $library1->branchcode >- }, >- $biblio_3->biblionumber >+ my $item_3 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_3->biblionumber, >+ library => $library1->branchcode >+ } > ); > > # Test 1: Patron 3 can place hold >@@ -1047,25 +1048,26 @@ subtest 'CanItemBeReserved / pickup_not_in_hold_group' => sub { > > # Create 3 biblios with items > my $biblio_1 = $builder->build_sample_biblio({ itemtype => $itemtype1->itemtype }); >- my ( undef, undef, $itemnumber_1 ) = AddItem( >- { homebranch => $library1->branchcode, >- holdingbranch => $library1->branchcode >- }, >- $biblio_1->biblionumber >+ my $item_1 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_1->biblionumber, >+ library => $library1->branchcode >+ } > ); > my $biblio_2 = $builder->build_sample_biblio({ itemtype => $itemtype2->itemtype }); >- my ( undef, undef, $itemnumber_2 ) = AddItem( >- { homebranch => $library2->branchcode, >- holdingbranch => $library2->branchcode >- }, >- $biblio_2->biblionumber >+ my $item_2 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_2->biblionumber, >+ library => $library2->branchcode >+ } > ); >+ my $itemnumber_2 = $item_2->itemnumber; > my $biblio_3 = $builder->build_sample_biblio({ itemtype => $itemtype1->itemtype }); >- my ( undef, undef, $itemnumber_3 ) = AddItem( >- { homebranch => $library1->branchcode, >- holdingbranch => $library1->branchcode >- }, >- $biblio_3->biblionumber >+ my $item_3 = $builder->build_sample_item( >+ { >+ biblionumber => $biblio_3->biblionumber, >+ library => $library1->branchcode >+ } > ); > > # Test 1: Patron 3 can place hold >diff --git a/t/db_dependent/Members/GetAllIssues.t b/t/db_dependent/Members/GetAllIssues.t >index 54cc5cb203..679cd45352 100644 >--- a/t/db_dependent/Members/GetAllIssues.t >+++ b/t/db_dependent/Members/GetAllIssues.t >@@ -60,7 +60,7 @@ my $itemnumber1 = $builder->build_sample_item({ biblionumber => $biblionumber1, > my $itemnumber2 = $builder->build_sample_item({ biblionumber => $biblionumber1, barcode => '0102', %item_infos })->itemnumber; > > my ($biblionumber2) = AddBiblio( MARC::Record->new, '' ); >-my $itemnumber2 = $builder->build_sample_item({ biblionumber => $biblionumber2, barcode => '0202', %item_infos })->itemnumber; >+my $itemnumber3 = $builder->build_sample_item({ biblionumber => $biblionumber2, barcode => '0202', %item_infos })->itemnumber; > > my $borrowernumber1 = > Koha::Patron->new({ categorycode => $categorycode, branchcode => $branchcode })->store->borrowernumber; >@@ -100,7 +100,7 @@ is( $issues->[1]->{itemnumber}, $itemnumber2, '' ); > $issues = C4::Members::GetAllIssues($borrowernumber2); > is( @$issues, 0, 'GetAllIssues returns the correct number of elements' ); > >-AddIssue( $borrower2, '0203' ); >+AddIssue( $borrower2, '0202' ); > $issues = C4::Members::GetAllIssues($borrowernumber1); > is( @$issues, 2, 'GetAllIssues returns the correct number of elements' ); > is( $issues->[0]->{itemnumber}, $itemnumber1, '' ); >diff --git a/t/db_dependent/Reserves.t b/t/db_dependent/Reserves.t >index d3884c0152..8a9677aa5c 100755 >--- a/t/db_dependent/Reserves.t >+++ b/t/db_dependent/Reserves.t >@@ -404,7 +404,7 @@ is($new_count, $hold_notice_count + 1, 'patron not notified a second time (bug 1 > > # avoiding the not_same_branch error > t::lib::Mocks::mock_preference('IndependentBranches', 0); >-my $item = Koha::Items->find($itemnumber); >+$item = Koha::Items->find($item->itemnumber); > is( > $item->safe_delete, > 'book_reserved', >-- >2.20.1
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 23463
:
95899
|
95900
|
95901
|
95902
|
95903
|
95904
|
95905
|
95906
|
95907
|
95908
|
95909
|
95910
|
95911
|
95912
|
95913
|
95914
|
95915
|
95916
|
95917
|
95918
|
95919
|
95920
|
95921
|
95922
|
95923
|
95925
|
96145
|
97895
|
97896
|
97897
|
97898
|
97899
|
97900
|
97901
|
97902
|
97903
|
97904
|
97905
|
97906
|
97907
|
97908
|
97909
|
97910
|
97911
|
97912
|
97913
|
97914
|
97915
|
97916
|
97917
|
97918
|
97919
|
97920
|
97921
|
101151
|
101152
|
101153
|
101154
|
101156
|
101157
|
101158
|
101161
|
101163
|
101165
|
101167
|
101169
|
101170
|
101171
|
101172
|
101173
|
101174
|
101175
|
101176
|
101177
|
101178
|
101179
|
101180
|
101181
|
101182
|
101183
|
101184
|
101185
|
101186
|
101188
|
101189
|
101190
|
101191
|
101192
|
101193
|
101194
|
101195
|
101196
|
101197
|
101246
|
101247
|
101248
|
101249
|
101250
|
101251
|
101252
|
101253
|
101254
|
101255
|
101256
|
101257
|
101258
|
101259
|
101260
|
101261
|
101262
|
101263
|
101264
|
101265
|
101266
|
101267
|
101268
|
101269
|
101270
|
101271
|
101272
|
101273
|
101274
|
101275
|
101276
| 101277 |
101278
|
101279
|
101280
|
101281
|
101282
|
101283
|
101284
|
101413
|
101414
|
101415
|
101416
|
101432
|
101476
|
102071
|
103129
|
113581