Lines 83-118
my ($bibnum, $bibitemnum);
Link Here
|
83 |
($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); |
83 |
($bibnum, $title, $bibitemnum) = AddBiblio($bib, ''); |
84 |
|
84 |
|
85 |
my $miniaturist = MARC::Record->new(); |
85 |
my $miniaturist = MARC::Record->new(); |
86 |
my $title = 'The Miniaturist'; |
86 |
my $title_14155a = 'The Miniaturist'; |
87 |
if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
87 |
if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
88 |
$miniaturist->append_fields( |
88 |
$miniaturist->append_fields( |
89 |
MARC::Field->new('600', '', '1', a => 'Burton, Jessie'), |
89 |
MARC::Field->new('600', '', '1', a => 'Burton, Jessie'), |
90 |
MARC::Field->new('200', '', '', a => $title), |
90 |
MARC::Field->new('200', '', '', a => $title_14155a), |
91 |
); |
91 |
); |
92 |
} |
92 |
} |
93 |
else { |
93 |
else { |
94 |
$miniaturist->append_fields( |
94 |
$miniaturist->append_fields( |
95 |
MARC::Field->new('100', '', '', a => 'Burton, Jessie'), |
95 |
MARC::Field->new('100', '', '', a => 'Burton, Jessie'), |
96 |
MARC::Field->new('245', '', '', a => $title), |
96 |
MARC::Field->new('245', '', '', a => $title_14155a), |
97 |
); |
97 |
); |
98 |
} |
98 |
} |
99 |
my ($miniaturist_id, $title, $bibitemnum) = AddBiblio($miniaturist, ''); |
99 |
my ($miniaturist_id, $bibitemnum_14155a); |
|
|
100 |
($miniaturist_id, $title_14155a, $bibitemnum_14155a) = AddBiblio($miniaturist, ''); |
100 |
|
101 |
|
101 |
my $broken = MARC::Record->new(); |
102 |
my $broken = MARC::Record->new(); |
102 |
my $title = 'The broken'; |
103 |
my $title_14155b = 'The broken'; |
103 |
if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
104 |
if( C4::Context->preference('marcflavour') eq 'UNIMARC' ) { |
104 |
$broken->append_fields( |
105 |
$broken->append_fields( |
105 |
MARC::Field->new('600', '', '1', a => 'Cohen, Tamar'), |
106 |
MARC::Field->new('600', '', '1', a => 'Cohen, Tamar'), |
106 |
MARC::Field->new('200', '', '', a => $title), |
107 |
MARC::Field->new('200', '', '', a => $title_14155b), |
107 |
); |
108 |
); |
108 |
} |
109 |
} |
109 |
else { |
110 |
else { |
110 |
$broken->append_fields( |
111 |
$broken->append_fields( |
111 |
MARC::Field->new('100', '', '', a => 'Cohen, Tamar'), |
112 |
MARC::Field->new('100', '', '', a => 'Cohen, Tamar'), |
112 |
MARC::Field->new('245', '', '', a => $title), |
113 |
MARC::Field->new('245', '', '', a => $title_14155b), |
113 |
); |
114 |
); |
114 |
} |
115 |
} |
115 |
my ($broken_id, $title, $bibitemnum) = AddBiblio($broken, ''); |
116 |
my ($broken_id, $bibitemnum_14155b); |
|
|
117 |
($broken_id, $title_14155b, $bibitemnum_14155b) = AddBiblio($broken, ''); |
116 |
|
118 |
|
117 |
# Create a helper item instance for testing |
119 |
# Create a helper item instance for testing |
118 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); |
120 |
my ($item_bibnum, $item_bibitemnum, $itemnumber) = AddItem({ homebranch => 'CPL', holdingbranch => 'CPL' } , $bibnum); |
Lines 168-183
ok(!ReachedMaxReserves($borrowernumber), 'First borrower doesn\'t reached max re
Link Here
|
168 |
|
170 |
|
169 |
AddReserve($branch, $borrowernumber, $miniaturist_id, |
171 |
AddReserve($branch, $borrowernumber, $miniaturist_id, |
170 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
172 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
171 |
$title, $checkitem, $found); |
173 |
$title_14155a, $checkitem, $found); |
172 |
|
174 |
|
173 |
AddReserve($branch, $borrowernumber, $broken_id, |
175 |
AddReserve($branch, $borrowernumber, $broken_id, |
174 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
176 |
$constraint, $bibitems, $priority, $resdate, $expdate, $notes, |
175 |
$title, $checkitem, $found); |
177 |
$title_14155b, $checkitem, $found); |
176 |
|
178 |
|
177 |
ok(ReachedMaxReserves($borrowernumber), 'First borrower reached max reserves'); |
179 |
ok(ReachedMaxReserves($borrowernumber), 'First borrower reached max reserves'); |
178 |
|
180 |
|
179 |
t::lib::Mocks::mock_preference('maxreserves', 15); |
|
|
180 |
|
181 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
181 |
my $ReservesControlBranch = C4::Context->preference('ReservesControlBranch'); |
182 |
C4::Context->set_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
182 |
C4::Context->set_preference( 'ReservesControlBranch', 'ItemHomeLibrary' ); |
183 |
ok( |
183 |
ok( |
184 |
- |
|
|