Bugzilla – Attachment 66347 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: Test C4/Labels/Label.pm changes
Bug-14385-Test-C4LabelsLabelpm-changes.patch (text/plain), 5.11 KB, created by
Mark Tompsett
on 2017-08-22 14:50:59 UTC
(
hide
)
Description:
Bug 14385: Test C4/Labels/Label.pm changes
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2017-08-22 14:50:59 UTC
Size:
5.11 KB
patch
obsolete
>From f2a3a9226d337a66f7b6e8342d3bf2be3048c489 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Tue, 22 Aug 2017 14:30:13 +0000 >Subject: [PATCH] Bug 14385: Test C4/Labels/Label.pm changes > >--- > t/db_dependent/Labels/t_Label.t | 147 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 147 insertions(+) > create mode 100644 t/db_dependent/Labels/t_Label.t > >diff --git a/t/db_dependent/Labels/t_Label.t b/t/db_dependent/Labels/t_Label.t >new file mode 100644 >index 0000000..4f60b07 >--- /dev/null >+++ b/t/db_dependent/Labels/t_Label.t >@@ -0,0 +1,147 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Copyright (C) 2017 Mark Tompsett >+# >+# 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 t::lib::TestBuilder; >+ >+use MARC::Record; >+use MARC::Field; >+use Data::Dumper; >+ >+use C4::Biblio; >+use C4::Items; >+use C4::Labels::Layout; >+ >+use Koha::Database; >+ >+use_ok('C4::Labels::Label'); >+ >+my $database = Koha::Database->new(); >+my $schema = $database->schema(); >+$schema->storage->txn_begin(); >+ >+my $batch_id; >+my ( $llx, $lly ) = ( 0, 0 ); >+my $frameworkcode = q{}; >+ >+## Setup Test >+my $builder = t::lib::TestBuilder->new; >+ >+# Add branch >+my $branch_1 = $builder->build( { source => 'Branch' } )->{branchcode}; >+ >+# Add categories >+my $category_1 = $builder->build( { source => 'Category' } )->{categorycode}; >+ >+# Add an item type >+my $itemtype = >+ $builder->build( { source => 'Itemtype', value => { notforloan => undef } } ) >+ ->{itemtype}; >+ >+C4::Context->set_userenv( undef, undef, undef, undef, undef, undef, $branch_1 ); >+ >+# Create a helper biblio >+my $bib = MARC::Record->new(); >+my $title = 'Silence in the library'; >+if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { >+ $bib->append_fields( >+ MARC::Field->new( '600', q{}, '1', a => 'Moffat, Steven' ), >+ MARC::Field->new( '200', q{}, q{}, a => $title ), >+ ); >+} >+else { >+ $bib->append_fields( >+ MARC::Field->new( '100', q{}, q{}, a => 'Moffat, Steven' ), >+ MARC::Field->new( '245', q{}, q{}, a => $title ), >+ ); >+} >+my ($bibnum) = AddBiblio( $bib, $frameworkcode ); >+ >+# Create a helper item instance for testing >+my ( $item_bibnum, $item_bibitemnum, $itemnumber ) = AddItem( >+ { >+ homebranch => $branch_1, >+ holdingbranch => $branch_1, >+ itype => $itemtype >+ }, >+ $bibnum >+); >+ >+# Modify item; setting barcode. >+my $testbarcode = '97531'; >+ModItem( { barcode => $testbarcode }, $bibnum, $itemnumber ); >+ >+my $layout = C4::Labels::Layout->new( layout_name => 'TEST' ); >+ >+my $dummy_template_values = { >+ creator => 'Labels', >+ profile_id => 0, >+ template_code => 'Avery 5160 | 1 x 2-5/8', >+ template_desc => '3 columns, 10 rows of labels', >+ page_width => 8.5, >+ page_height => 11, >+ label_width => 2.63, >+ label_height => 1, >+ top_text_margin => 0.139, >+ left_text_margin => 0.0417, >+ top_margin => 0.35, >+ left_margin => 0.23, >+ cols => 3, >+ rows => 10, >+ col_gap => 0.13, >+ row_gap => 0, >+ units => 'INCH', >+ template_stat => 1, >+}; >+ >+my $label = C4::Labels::Label->new( >+ batch_id => $batch_id, >+ item_number => $itemnumber, >+ llx => $llx, >+ lly => $lly, >+ width => $dummy_template_values->{'label_width'}, >+ height => $dummy_template_values->{'label_height'}, >+ top_text_margin => $dummy_template_values->{'top_text_margin'}, >+ left_text_margin => $dummy_template_values->{'left_text_margin'}, >+ barcode_type => $layout->get_attr('barcode_type'), >+ printing_type => 'BIB', >+ guidebox => $layout->get_attr('guidebox'), >+ oblique_title => $layout->get_attr('oblique_title'), >+ font => $layout->get_attr('font'), >+ font_size => $layout->get_attr('font_size'), >+ callnum_split => $layout->get_attr('callnum_split'), >+ justify => $layout->get_attr('text_justify'), >+ format_string => $layout->get_attr('format_string'), >+ text_wrap_cols => $layout->get_text_wrap_cols( >+ label_width => $dummy_template_values->{'label_width'}, >+ left_text_margin => $dummy_template_values->{'left_text_margin'} >+ ), >+); >+ >+my $label_text = $label->create_label(); >+ok( defined $label_text, 'Label Text Value defined.' ); >+ >+my $label_csv_data = $label->csv_data(); >+ok( defined $label_csv_data, 'Label CSV Data defined' ); >+ >+$schema->storage->txn_rollback(); >+ >+1; >-- >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