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

(-)a/t/db_dependent/Reserves.t (-21 / +41 lines)
Lines 106-114 my %data = ( Link Here
106
    surname => 'my surname',
106
    surname => 'my surname',
107
    categorycode => $category_1,
107
    categorycode => $category_1,
108
    branchcode => $branch_1,
108
    branchcode => $branch_1,
109
    dateofbirth => undef,
109
);
110
);
110
Koha::Patron::Categories->find($category_1)->set({ enrolmentfee => 0})->store;
111
Koha::Patron::Categories->find($category_1)->set({ enrolmentfee => 0})->store;
111
my $borrowernumber = AddMember(%data);
112
my $patron = $builder->build({
113
    source => 'Borrower',
114
    value => \%data,
115
});
116
my $borrowernumber = $patron->{borrowernumber};
112
my $borrower = GetMember( borrowernumber => $borrowernumber );
117
my $borrower = GetMember( borrowernumber => $borrowernumber );
113
my $biblionumber   = $bibnum;
118
my $biblionumber   = $bibnum;
114
my $barcode        = $testbarcode;
119
my $barcode        = $testbarcode;
Lines 160-187 t::lib::Mocks::mock_preference( 'ReservesControlBranch', $ReservesControlBranch Link Here
160
### Regression test for bug 10272
165
### Regression test for bug 10272
161
###
166
###
162
my %requesters = ();
167
my %requesters = ();
163
$requesters{$branch_1} = AddMember(
168
my $patron_branch1 = $builder->build({
164
    branchcode   => $branch_1,
169
    source => 'Borrower',
165
    categorycode => $category_2,
170
    value => {
166
    surname      => "borrower from $branch_1",
167
);
168
for my $i ( 2 .. 5 ) {
169
    $requesters{"CPL$i"} = AddMember(
170
        branchcode   => $branch_1,
171
        branchcode   => $branch_1,
171
        categorycode => $category_2,
172
        categorycode => $category_2,
172
        surname      => "borrower $i from $branch_1",
173
        surname      => "borrower from $branch_1",
173
    );
174
    },
175
});
176
$requesters{$branch_1} = $patron_branch1->{borrowernumber};
177
for my $i ( 2 .. 5 ) {
178
    my $patron_cpl = $builder->build({
179
        source => 'Borrower',
180
        value => {
181
            branchcode   => $branch_1,
182
            categorycode => $category_2,
183
            surname      => "borrower $i from $branch_1",
184
        },
185
    });
186
    $requesters{"CPL$i"} = $patron_cpl;
174
}
187
}
175
$requesters{$branch_2} = AddMember(
188
my $patron_branch2 = $builder->build({
176
    branchcode   => $branch_2,
189
    source => 'Borrower',
177
    categorycode => $category_2,
190
    value => {
178
    surname      => "borrower from $branch_2",
191
        branchcode   => $branch_2,
179
);
192
        categorycode => $category_2,
180
$requesters{$branch_3} = AddMember(
193
        surname      => "borrower from $branch_2",
181
    branchcode   => $branch_3,
194
    }
182
    categorycode => $category_2,
195
});
183
    surname      => "borrower from $branch_3",
196
$requesters{$branch_2} = $patron_branch2->{borrowernumber};
184
);
197
my $patron_branch3 = $builder->build({
198
    source => 'Borrower',
199
    value => {
200
        branchcode   => $branch_3,
201
        categorycode => $category_2,
202
        surname      => "borrower from $branch_3",
203
    },
204
});
205
$requesters{$branch_3} = $patron_branch3->{borrowernumber};
185
206
186
# Configure rules so that $branch_1 allows only $branch_1 patrons
207
# Configure rules so that $branch_1 allows only $branch_1 patrons
187
# to request its items, while $branch_2 will allow its items
208
# to request its items, while $branch_2 will allow its items
188
- 

Return to bug 17917