Lines 268-279
subtest 'search_limited' => sub {
Link Here
|
268 |
|
268 |
|
269 |
my $group_1 = Koha::Library::Group->new( { title => 'TEST Group 1' } )->store; |
269 |
my $group_1 = Koha::Library::Group->new( { title => 'TEST Group 1' } )->store; |
270 |
my $group_2 = Koha::Library::Group->new( { title => 'TEST Group 2' } )->store; |
270 |
my $group_2 = Koha::Library::Group->new( { title => 'TEST Group 2' } )->store; |
271 |
Koha::Library::Group->new({ parent_id => $group_1->id, branchcode => $patron->branchcode })->store(); |
271 |
Koha::Library::Group->new( { parent_id => $group_1->id, branchcode => $patron->branchcode } )->store(); |
272 |
Koha::Library::Group->new({ parent_id => $group_2->id, branchcode => $patron_2->branchcode })->store(); |
272 |
Koha::Library::Group->new( { parent_id => $group_2->id, branchcode => $patron_2->branchcode } )->store(); |
273 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); # Is superlibrarian |
273 |
t::lib::Mocks::mock_userenv( { patron => $patron } ); # Is superlibrarian |
274 |
is( Koha::Notice::Messages->search_limited->count, $nb_messages, 'Koha::Notice::Messages->search_limited should return all generated notices for superlibrarian' ); |
274 |
is( |
275 |
t::lib::Mocks::mock_userenv( { patron => $patron_2 } ); # Is restricted |
275 |
Koha::Notice::Messages->search_limited->count, $nb_messages, |
276 |
is( Koha::Notice::Messages->search_limited->count, 1, 'Koha:Notice::Messages->search_limited should not return all generated notices for restricted patron' ); |
276 |
'Koha::Notice::Messages->search_limited should return all generated notices for superlibrarian' |
|
|
277 |
); |
278 |
t::lib::Mocks::mock_userenv( { patron => $patron_2 } ); # Is restricted |
279 |
is( |
280 |
Koha::Notice::Messages->search_limited->count, 1, |
281 |
'Koha:Notice::Messages->search_limited should not return all generated notices for restricted patron' |
282 |
); |
277 |
}; |
283 |
}; |
278 |
|
284 |
|
279 |
1; |
285 |
1; |
280 |
- |
|
|