7 use t::lib::TestBuilder;
9 use Test::More tests => 3;
11 my $schema = Koha::Database->new->schema;
12 $schema->storage->txn_begin;
13 my $dbh = C4::Context->dbh;
14 my $builder = t::lib::TestBuilder->new;
16 use_ok('Koha::RestrictionType');
17 use_ok('Koha::RestrictionTypes');
19 $dbh->do(q|DELETE FROM borrower_debarments|);
20 $dbh->do(q|DELETE FROM debarment_types|);
24 source => 'DebarmentType',
27 display_text => 'One',
35 source => 'DebarmentType',
38 display_text => 'Two',
46 my $keyed = Koha::RestrictionTypes->keyed_on_code;
50 display_text => 'One',
56 display_text => 'Two',
62 is_deeply( $keyed, $expecting, 'keyed_on_code returns correctly' );
64 $schema->storage->txn_rollback;