View | Details | Raw Unified | Return to bug 14155
Collapse All | Expand All

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

Return to bug 14155