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

(-)a/t/db_dependent/Koha.t (-4 / +9 lines)
Lines 240-252 subtest 'ISBN tests' => sub { Link Here
240
};
240
};
241
241
242
subtest 'GetItemTypesCategorized test' => sub{
242
subtest 'GetItemTypesCategorized test' => sub{
243
    plan tests => 7;
243
    plan tests => 9;
244
244
245
    my $avc = Koha::AuthorisedValueCategories->find('ITEMTYPECAT');
245
    my $avc = Koha::AuthorisedValueCategories->find('ITEMTYPECAT');
246
    Koha::AuthorisedValueCategory->new({ category_name => 'ITEMTYPECAT' })->store unless $avc;
246
    Koha::AuthorisedValueCategory->new({ category_name => 'ITEMTYPECAT' })->store unless $avc;
247
    my $insertGroup = Koha::AuthorisedValue->new(
247
    my $insertGroup = Koha::AuthorisedValue->new(
248
        {   category         => 'ITEMTYPECAT',
248
        {   category         => 'ITEMTYPECAT',
249
            authorised_value => 'Quertyware',
249
            authorised_value => 'Qwertyware',
250
            lib              => 'Keyboard software',
251
            lib_opac         => 'Computer stuff',
250
        }
252
        }
251
    )->store;
253
    )->store;
252
254
Lines 270-276 subtest 'GetItemTypesCategorized test' => sub{ Link Here
270
    # add more data since GetItemTypesCategorized's search is more subtle
272
    # add more data since GetItemTypesCategorized's search is more subtle
271
    $insertGroup = Koha::AuthorisedValue->new(
273
    $insertGroup = Koha::AuthorisedValue->new(
272
        {   category         => 'ITEMTYPECAT',
274
        {   category         => 'ITEMTYPECAT',
273
            authorised_value => 'Varyheavybook',
275
            authorised_value => 'Veryheavybook',
276
            lib              => 'Weighty literature',
274
        }
277
        }
275
    )->store;
278
    )->store;
276
279
Lines 281-286 subtest 'GetItemTypesCategorized test' => sub{ Link Here
281
    ok($hrCat->{Veryheavybook} &&
284
    ok($hrCat->{Veryheavybook} &&
282
       $hrCat->{Veryheavybook}->{hideinopac}==1, 'GetItemTypesCategorized: non-visible category hidden' );
285
       $hrCat->{Veryheavybook}->{hideinopac}==1, 'GetItemTypesCategorized: non-visible category hidden' );
283
286
287
    is( $hrCat->{Veryheavybook}->{description}, 'Weighty literature', 'A category with only lib description passes through');
288
    is( $hrCat->{Qwertyware}->{description}, 'Computer stuff', 'A category with lib_opac description uses that');
289
284
    $insertSth->execute('BKghjklo5', 'An hidden book', 'Qwertyware', 1);
290
    $insertSth->execute('BKghjklo5', 'An hidden book', 'Qwertyware', 1);
285
    $hrCat = GetItemTypesCategorized();
291
    $hrCat = GetItemTypesCategorized();
286
    ok(exists $hrCat->{Qwertyware}, 'GetItemTypesCategorized: partially visible category exists');
292
    ok(exists $hrCat->{Qwertyware}, 'GetItemTypesCategorized: partially visible category exists');
287
- 

Return to bug 22302