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

(-)a/t/db_dependent/Items.t (-2 / +20 lines)
Lines 29-34 use Koha::Library; Link Here
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
use Koha::MarcSubfieldStructures;
30
use Koha::MarcSubfieldStructures;
31
use Koha::Caches;
31
use Koha::Caches;
32
use Koha::AuthorisedValues;
32
33
33
use t::lib::Mocks;
34
use t::lib::Mocks;
34
use t::lib::TestBuilder;
35
use t::lib::TestBuilder;
Lines 250-256 subtest 'GetHiddenItemnumbers tests' => sub { Link Here
250
251
251
subtest 'GetItemsInfo tests' => sub {
252
subtest 'GetItemsInfo tests' => sub {
252
253
253
    plan tests => 4;
254
    plan tests => 7;
254
255
255
    $schema->storage->txn_begin;
256
    $schema->storage->txn_begin;
256
257
Lines 265-270 subtest 'GetItemsInfo tests' => sub { Link Here
265
        source => 'Itemtype',
266
        source => 'Itemtype',
266
    });
267
    });
267
268
269
    Koha::AuthorisedValues->delete;
270
    my $av1 = Koha::AuthorisedValue->new(
271
        {
272
            category         => 'RESTRICTED',
273
            authorised_value => '1',
274
            lib              => 'Restricted Access',
275
            lib_opac         => 'Restricted Access OPAC',
276
        }
277
    )->store();
278
268
    # Add a biblio
279
    # Add a biblio
269
    my $biblio = $builder->build_sample_biblio();
280
    my $biblio = $builder->build_sample_biblio();
270
    # Add an item
281
    # Add an item
Lines 273-278 subtest 'GetItemsInfo tests' => sub { Link Here
273
            homebranch    => $library1->{branchcode},
284
            homebranch    => $library1->{branchcode},
274
            holdingbranch => $library2->{branchcode},
285
            holdingbranch => $library2->{branchcode},
275
            itype         => $itemtype->{itemtype},
286
            itype         => $itemtype->{itemtype},
287
            restricted    => 1,
276
        },
288
        },
277
        $biblio->biblionumber
289
        $biblio->biblionumber
278
    );
290
    );
Lines 287-298 subtest 'GetItemsInfo tests' => sub { Link Here
287
299
288
    my @results = GetItemsInfo( $biblio->biblionumber );
300
    my @results = GetItemsInfo( $biblio->biblionumber );
289
    ok( @results, 'GetItemsInfo returns results');
301
    ok( @results, 'GetItemsInfo returns results');
302
290
    is( $results[0]->{ home_branch_opac_info }, "homebranch OPAC info",
303
    is( $results[0]->{ home_branch_opac_info }, "homebranch OPAC info",
291
        'GetItemsInfo returns the correct home branch OPAC info notice' );
304
        'GetItemsInfo returns the correct home branch OPAC info notice' );
292
    is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info",
305
    is( $results[0]->{ holding_branch_opac_info }, "holdingbranch OPAC info",
293
        'GetItemsInfo returns the correct holding branch OPAC info notice' );
306
        'GetItemsInfo returns the correct holding branch OPAC info notice' );
294
    is( exists( $results[0]->{ onsite_checkout } ), 1,
307
    is( exists( $results[0]->{ onsite_checkout } ), 1,
295
        'GetItemsInfo returns a onsite_checkout key' );
308
        'GetItemsInfo returns a onsite_checkout key' );
309
    is( $results[0]->{ restricted }, 1,
310
        'GetItemsInfo returns a restricted value code' );
311
    is( $results[0]->{ restrictedvalue }, "Restricted Access",
312
        'GetItemsInfo returns a restricted value description (staff)' );
313
    is( $results[0]->{ restrictedvalueopac }, "Restricted Access OPAC",
314
        'GetItemsInfo returns a restricted value description (OPAC)' );
296
315
297
    $schema->storage->txn_rollback;
316
    $schema->storage->txn_rollback;
298
};
317
};
299
- 

Return to bug 10676