Lines 143-149
subtest '->author' => sub {
Link Here
|
143 |
|
143 |
|
144 |
subtest '->search_for_display' => sub { |
144 |
subtest '->search_for_display' => sub { |
145 |
|
145 |
|
146 |
plan tests => 12; |
146 |
plan tests => 13; |
147 |
|
147 |
|
148 |
$schema->storage->txn_begin; |
148 |
$schema->storage->txn_begin; |
149 |
|
149 |
|
Lines 248-253
subtest '->search_for_display' => sub {
Link Here
|
248 |
$news = Koha::News->search_for_display({ library_id => $library2->branchcode}); |
248 |
$news = Koha::News->search_for_display({ library_id => $library2->branchcode}); |
249 |
is($news->count, 2, 'Filtering by library returns right number of news items'); |
249 |
is($news->count, 2, 'Filtering by library returns right number of news items'); |
250 |
|
250 |
|
|
|
251 |
$news = Koha::News->search_for_display({ type => 'NonExistantType', lang => 'en'}); |
252 |
is($news->count, 0, 'Non-existant type is searched, but should not find any item'); |
253 |
|
251 |
throws_ok { Koha::News->search_for_display({type => 'opac'}) } 'Koha::Exceptions::BadParameter', |
254 |
throws_ok { Koha::News->search_for_display({type => 'opac'}) } 'Koha::Exceptions::BadParameter', |
252 |
'Exception raised when type is opac and no language given'; |
255 |
'Exception raised when type is opac and no language given'; |
253 |
|
256 |
|
254 |
- |
|
|