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

(-)a/t/db_dependent/Holds.t (-3 / +3 lines)
Lines 44-50 my $builder = t::lib::TestBuilder->new(); Link Here
44
my $dbh     = C4::Context->dbh;
44
my $dbh     = C4::Context->dbh;
45
45
46
# Create two random branches
46
# Create two random branches
47
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode };
47
my $branch_1 = $builder->build({ source => 'Branch', value => { 'pickup_location' => 1 }})->{ branchcode };
48
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
48
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
49
49
50
my $category = $builder->build({ source => 'Category' });
50
my $category = $builder->build({ source => 'Category' });
Lines 1483-1490 subtest 'non priority holds' => sub { Link Here
1483
        }
1483
        }
1484
    );
1484
    );
1485
1485
1486
    my $item = $builder->build_sample_item;
1486
    my $branch  = $builder->build_object( { class => 'Koha::Libraries', value => { pickup_location => 1 } } );
1487
1487
    my $item = $builder->build_sample_item({ library => $branch->branchcode });
1488
    my $patron1 = $builder->build_object(
1488
    my $patron1 = $builder->build_object(
1489
        {
1489
        {
1490
            class => 'Koha::Patrons',
1490
            class => 'Koha::Patrons',
(-)a/t/db_dependent/Reserves.t (-8 / +34 lines)
Lines 71-79 $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode"); Link Here
71
71
72
## Setup Test
72
## Setup Test
73
# Add branches
73
# Add branches
74
my $branch_1 = $builder->build({ source => 'Branch' })->{ branchcode };
74
my $branch_1 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
75
my $branch_2 = $builder->build({ source => 'Branch' })->{ branchcode };
75
my $branch_2 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
76
my $branch_3 = $builder->build({ source => 'Branch' })->{ branchcode };
76
my $branch_3 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
77
# Add categories
77
# Add categories
78
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode };
78
my $category_1 = $builder->build({ source => 'Category' })->{ categorycode };
79
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode };
79
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode };
Lines 108-113 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
108
my $borrower = $patron->unblessed;
108
my $borrower = $patron->unblessed;
109
my $biblionumber   = $bibnum;
109
my $biblionumber   = $bibnum;
110
110
111
# Set circulation rules
112
Koha::CirculationRules->set_rules(
113
    {
114
        categorycode => undef,
115
        branchcode   => undef,
116
        itemtype     => undef,
117
        rules        => {
118
            reservesallowed  => 25,
119
            holds_per_record => 99,
120
        }
121
    }
122
);
123
111
my $branchcode = Koha::Libraries->search->next->branchcode;
124
my $branchcode = Koha::Libraries->search->next->branchcode;
112
125
113
AddReserve(
126
AddReserve(
Lines 212-217 Koha::CirculationRules->set_rules( Link Here
212
        }
225
        }
213
    }
226
    }
214
);
227
);
228
Koha::CirculationRules->set_rules(
229
    {
230
        categorycode => undef,
231
        branchcode   => undef,
232
        itemtype     => undef,
233
        rules        => {
234
            reservesallowed  => 25,
235
            holds_per_record => 99,
236
        }
237
    }
238
);
215
239
216
my $bibnum2 = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber;
240
my $bibnum2 = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber;
217
241
Lines 1088-1096 subtest 'MoveReserve additional test' => sub { Link Here
1088
1112
1089
    # Create the items and patrons we need
1113
    # Create the items and patrons we need
1090
    my $biblio = $builder->build_sample_biblio();
1114
    my $biblio = $builder->build_sample_biblio();
1115
    my $branch = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
1091
    my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } });
1116
    my $itype = $builder->build_object({ class => "Koha::ItemTypes", value => { notforloan => 0 } });
1092
    my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber,notforloan => 0, itype => $itype->itemtype });
1117
    my $item_1 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber,notforloan => 0, itype => $itype->itemtype, library => $branch });
1093
    my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, notforloan => 0, itype => $itype->itemtype });
1118
    my $item_2 = $builder->build_sample_item({ biblionumber => $biblio->biblionumber, notforloan => 0, itype => $itype->itemtype, library => $branch });
1094
    my $patron_1 = $builder->build_object({ class => "Koha::Patrons" });
1119
    my $patron_1 = $builder->build_object({ class => "Koha::Patrons" });
1095
    my $patron_2 = $builder->build_object({ class => "Koha::Patrons" });
1120
    my $patron_2 = $builder->build_object({ class => "Koha::Patrons" });
1096
1121
Lines 1172-1179 subtest 'RevertWaitingStatus' => sub { Link Here
1172
subtest 'CheckReserves additional tests' => sub {
1197
subtest 'CheckReserves additional tests' => sub {
1173
1198
1174
    plan tests => 8;
1199
    plan tests => 8;
1200
    my $branch_1 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
1201
    my $branch_2 = $builder->build({ source => 'Branch', value => { pickup_location => 1 } })->{ branchcode };
1175
1202
1176
    my $item = $builder->build_sample_item;
1203
    my $item = $builder->build_sample_item({ library => $branch_1 });
1177
    my $reserve1 = $builder->build_object(
1204
    my $reserve1 = $builder->build_object(
1178
        {
1205
        {
1179
            class => "Koha::Holds",
1206
            class => "Koha::Holds",
Lines 1245-1251 subtest 'CheckReserves additional tests' => sub { Link Here
1245
        $reserve1->reserve_id, "We got the Transit reserve" );
1272
        $reserve1->reserve_id, "We got the Transit reserve" );
1246
    is( scalar @$possible_reserves, 2, 'We do get both reserves' );
1273
    is( scalar @$possible_reserves, 2, 'We do get both reserves' );
1247
1274
1248
    my $patron_B = $builder->build_object({ class => "Koha::Patrons" });
1275
    my $patron_B = $builder->build_object({ class => "Koha::Patrons", value => { branchcode => $branch_2,  } });
1249
    my $item_A = $builder->build_sample_item;
1276
    my $item_A = $builder->build_sample_item;
1250
    my $item_B = $builder->build_sample_item({
1277
    my $item_B = $builder->build_sample_item({
1251
        homebranch => $patron_B->branchcode,
1278
        homebranch => $patron_B->branchcode,
1252
- 

Return to bug 29750