Lines 81-87
my $category_2 = $builder->build({ source => 'Category' })->{ categorycode };
Link Here
|
81 |
my $itemtype = $builder->build( |
81 |
my $itemtype = $builder->build( |
82 |
{ source => 'Itemtype', value => { notforloan => undef } } )->{itemtype}; |
82 |
{ source => 'Itemtype', value => { notforloan => undef } } )->{itemtype}; |
83 |
|
83 |
|
84 |
t::lib::Mocks::mock_userenv({ branchcode => $branch_1 }); |
84 |
my $manager = $builder->build_object({class => 'Koha::Patrons', value => {branchcode => $branch_1} }); |
|
|
85 |
t::lib::Mocks::mock_userenv({ patron => $manager, branchcode => $branch_1 }); |
85 |
|
86 |
|
86 |
my $bibnum = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber; |
87 |
my $bibnum = $builder->build_sample_biblio({frameworkcode => $frameworkcode})->biblionumber; |
87 |
|
88 |
|
Lines 153-175
$requesters{$branch_1} = Koha::Patron->new({
Link Here
|
153 |
branchcode => $branch_1, |
154 |
branchcode => $branch_1, |
154 |
categorycode => $category_2, |
155 |
categorycode => $category_2, |
155 |
surname => "borrower from $branch_1", |
156 |
surname => "borrower from $branch_1", |
|
|
157 |
email => "totallyvalid\@email", |
156 |
})->store->borrowernumber; |
158 |
})->store->borrowernumber; |
157 |
for my $i ( 2 .. 5 ) { |
159 |
for my $i ( 2 .. 5 ) { |
158 |
$requesters{"CPL$i"} = Koha::Patron->new({ |
160 |
$requesters{"CPL$i"} = Koha::Patron->new({ |
159 |
branchcode => $branch_1, |
161 |
branchcode => $branch_1, |
160 |
categorycode => $category_2, |
162 |
categorycode => $category_2, |
161 |
surname => "borrower $i from $branch_1", |
163 |
surname => "borrower $i from $branch_1", |
|
|
164 |
email => "totallyvalid\@email", |
162 |
})->store->borrowernumber; |
165 |
})->store->borrowernumber; |
163 |
} |
166 |
} |
164 |
$requesters{$branch_2} = Koha::Patron->new({ |
167 |
$requesters{$branch_2} = Koha::Patron->new({ |
165 |
branchcode => $branch_2, |
168 |
branchcode => $branch_2, |
166 |
categorycode => $category_2, |
169 |
categorycode => $category_2, |
167 |
surname => "borrower from $branch_2", |
170 |
surname => "borrower from $branch_2", |
|
|
171 |
email => "totallyvalid\@email", |
168 |
})->store->borrowernumber; |
172 |
})->store->borrowernumber; |
169 |
$requesters{$branch_3} = Koha::Patron->new({ |
173 |
$requesters{$branch_3} = Koha::Patron->new({ |
170 |
branchcode => $branch_3, |
174 |
branchcode => $branch_3, |
171 |
categorycode => $category_2, |
175 |
categorycode => $category_2, |
172 |
surname => "borrower from $branch_3", |
176 |
surname => "borrower from $branch_3", |
|
|
177 |
email => "totallyvalid\@email", |
173 |
})->store->borrowernumber; |
178 |
})->store->borrowernumber; |
174 |
|
179 |
|
175 |
# Configure rules so that $branch_1 allows only $branch_1 patrons |
180 |
# Configure rules so that $branch_1 allows only $branch_1 patrons |
Lines 1733-1745
subtest 'CanItemBeReserved() tests' => sub {
Link Here
|
1733 |
$schema->storage->txn_rollback; |
1738 |
$schema->storage->txn_rollback; |
1734 |
}; |
1739 |
}; |
1735 |
|
1740 |
|
1736 |
subtest 'DefaultHoldExpiration tests' => sub { |
1741 |
subtest 'DefaultHoldExpirationdate tests' => sub { |
1737 |
plan tests => 2; |
1742 |
plan tests => 2; |
1738 |
$schema->storage->txn_begin; |
1743 |
$schema->storage->txn_begin; |
1739 |
|
1744 |
|
1740 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdate', 1 ); |
1745 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdate', 1 ); |
1741 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', 365 ); |
1746 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdatePeriod', 365 ); |
1742 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationUnitOfTime', 'days;' ); |
1747 |
t::lib::Mocks::mock_preference( 'DefaultHoldExpirationdateUnitOfTime', 'days' ); |
1743 |
|
1748 |
|
1744 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1749 |
my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); |
1745 |
my $item = $builder->build_sample_item(); |
1750 |
my $item = $builder->build_sample_item(); |
1746 |
- |
|
|