Bugzilla – Attachment 65411 Details for
Bug 14385
Extend OpacHiddenItems to allow specifying exempt borrower categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14385: Add missing test to trigger Koha/BiblioUtils/Iterator change
Bug-14385-Add-missing-test-to-trigger-KohaBiblioUt.patch (text/plain), 3.11 KB, created by
Mark Tompsett
on 2017-08-01 23:16:39 UTC
(
hide
)
Description:
Bug 14385: Add missing test to trigger Koha/BiblioUtils/Iterator change
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-08-01 23:16:39 UTC
Size:
3.11 KB
patch
obsolete
>From 0f1a5729c7f759a98a8e43372cec757ab4d467cb Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 1 Aug 2017 18:40:46 -0400 >Subject: [PATCH] Bug 14385: Add missing test to trigger > Koha/BiblioUtils/Iterator change > >--- > t/db_dependent/Koha/BiblioUtils/Iterator.t | 76 ++++++++++++++++++++++++++++++ > 1 file changed, 76 insertions(+) > create mode 100644 t/db_dependent/Koha/BiblioUtils/Iterator.t > >diff --git a/t/db_dependent/Koha/BiblioUtils/Iterator.t b/t/db_dependent/Koha/BiblioUtils/Iterator.t >new file mode 100644 >index 0000000..d436932 >--- /dev/null >+++ b/t/db_dependent/Koha/BiblioUtils/Iterator.t >@@ -0,0 +1,76 @@ >+#!/usr/bin/perl >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 3; >+ >+use_ok('Koha::BiblioUtils'); >+use_ok('Koha::BiblioUtils::Iterator'); >+ >+use C4::Biblio; >+use C4::Items; >+use DBI; >+use t::lib::TestBuilder; >+use t::lib::Mocks; >+ >+my $schema = Koha::Database->new()->schema(); >+$schema->storage->txn_begin(); >+my $dbh = C4::Context->dbh; >+$dbh->{RaiseError} = 1; >+ >+# blank all biblios, biblioitems, and items. >+$schema->resultset('Biblio')->delete(); >+ >+my $location = 'My Location'; >+my $builder = t::lib::TestBuilder->new; >+my $library = $builder->build({ >+ source => 'Branch', >+}); >+my $itemtype = $builder->build({ >+ source => 'Itemtype', >+}); >+ >+# Create a biblio instance for testing >+t::lib::Mocks::mock_preference('marcflavour', 'MARC21'); >+my ($bibnum, $bibitemnum) = get_biblio(); >+ >+# Add an item. >+my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => $library->{branchcode}, holdingbranch => $library->{branchcode}, location => $location, itype => $itemtype->{itemtype} } , $bibnum); >+ >+my $rs = $schema->resultset('Biblioitem')->search({}); >+my $iterator = Koha::BiblioUtils::Iterator->new($rs, items => 1 ); >+my $record = $iterator->next(); >+my $expected_tags = [ 100, 245, 952, 999 ]; >+my @result_tags = map { $_->tag() } $record->field('...'); >+my @sorted_tags = sort @result_tags; >+is_deeply(\@sorted_tags,$expected_tags, "Got the same tags as expected"); >+ >+$schema->storage->txn_rollback(); >+ >+# Helper method to set up a Biblio. >+sub get_biblio { >+ my ( $frameworkcode ) = @_; >+ $frameworkcode //= ''; >+ my $bib = MARC::Record->new(); >+ $bib->append_fields( >+ MARC::Field->new('100', ' ', ' ', a => 'Moffat, Steven'), >+ MARC::Field->new('245', ' ', ' ', a => 'Silence in the library'), >+ ); >+ my ($bibnum, $bibitemnum) = AddBiblio($bib, $frameworkcode); >+ return ($bibnum, $bibitemnum); >+} >-- >2.1.4
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 14385
:
40158
|
53483
|
53494
|
53505
|
53506
|
53507
|
55593
|
64688
|
64689
|
64690
|
64691
|
64692
|
64693
|
65322
|
65323
|
65324
|
65325
|
65376
|
65377
|
65378
|
65379
|
65380
|
65381
|
65382
|
65383
|
65384
|
65385
|
65386
|
65387
|
65388
|
65389
|
65408
|
65409
|
65410
|
65411
|
66103
|
66104
|
66105
|
66106
|
66107
|
66108
|
66109
|
66110
|
66111
|
66112
|
66113
|
66114
|
66115
|
66116
|
66117
|
66118
|
66125
|
66126
|
66127
|
66128
|
66129
|
66130
|
66131
|
66132
|
66192
|
66193
|
66194
|
66195
|
66196
|
66197
|
66198
|
66199
|
66200
|
66201
|
66202
|
66203
|
66204
|
66205
|
66206
|
66207
|
66208
|
66209
|
66210
|
66302
|
66303
|
66347
|
66361
|
66372
|
66401
|
66403
|
66520
|
66521
|
66522
|
66523
|
66524
|
66525
|
66526
|
66527
|
66528
|
66529
|
66530
|
66531
|
66532
|
66533
|
66534
|
66535
|
66536
|
66537
|
66538
|
66539
|
66540
|
66541
|
66542
|
66543
|
66544
|
66545
|
70256
|
70257
|
70258
|
70259
|
72445
|
72446
|
72447
|
72448
|
72449
|
72450
|
72451
|
72452
|
72453
|
72454
|
74001
|
78654
|
78655
|
78656
|
78657
|
78825
|
78826
|
78827
|
78828
|
80411
|
80463
|
80464
|
80465
|
80466
|
80467
|
89963
|
90038