Lines 158-164
subtest '->author' => sub {
Link Here
|
158 |
|
158 |
|
159 |
subtest '->search_for_display' => sub { |
159 |
subtest '->search_for_display' => sub { |
160 |
|
160 |
|
161 |
plan tests => 12; |
161 |
plan tests => 13; |
162 |
|
162 |
|
163 |
$schema->storage->txn_begin; |
163 |
$schema->storage->txn_begin; |
164 |
|
164 |
|
Lines 263-268
subtest '->search_for_display' => sub {
Link Here
|
263 |
$news = Koha::News->search_for_display({ library_id => $library2->branchcode}); |
263 |
$news = Koha::News->search_for_display({ library_id => $library2->branchcode}); |
264 |
is($news->count, 2, 'Filtering by library returns right number of news items'); |
264 |
is($news->count, 2, 'Filtering by library returns right number of news items'); |
265 |
|
265 |
|
|
|
266 |
$news = Koha::News->search_for_display({ type => 'NonExistantType', lang => 'en'}); |
267 |
is($news->count, 0, 'Non-existant type is searched, but should not find any item'); |
268 |
|
266 |
throws_ok { Koha::News->search_for_display({type => 'opac'}) } 'Koha::Exceptions::BadParameter', |
269 |
throws_ok { Koha::News->search_for_display({type => 'opac'}) } 'Koha::Exceptions::BadParameter', |
267 |
'Exception raised when type is opac and no language given'; |
270 |
'Exception raised when type is opac and no language given'; |
268 |
|
271 |
|
269 |
- |
|
|