Bug 9032: add ability to invite another to share a private list
[koha.git] / t / db_dependent / Category.t
blob21a0cf894f33ca80b0ed77863496f728973bc094
1 #!/usr/bin/perl
3 # This Koha test module is a stub!
4 # Add more tests here!!!
6 use Modern::Perl;
8 use Test::More tests => 3;
10 use_ok('C4::Category');
12 use C4::Context;
13 my $dbh = C4::Context->dbh;
14 $dbh->{RaiseError} = 1;
15 $dbh->{AutoCommit} = 0;
17 my $sth=$dbh->prepare('
18 INSERT INTO categories( categorycode, description, enrolmentperiod, enrolmentperioddate, upperagelimit, dateofbirthrequired, enrolmentfee, reservefee, hidelostitems, overduenoticerequired, category_type )
19 VALUES (?,?,?,?,?,?,?,?,?,?,?)
20 ');
22 my $nonexistent_categorycode = 'NONEXISTEN';
23 $sth->execute($nonexistent_categorycode, "Desc", 12, "2014-01-02", 99, 1, 1.5, 2.5, 0, 0, "A") || die $sth->errstr;
24 my @categories = C4::Category->all;
25 ok( @categories, 'all returns categories' );
27 my $match = grep {$_->{categorycode} eq $nonexistent_categorycode } @categories;
28 is( $match, 1, 'all returns the inserted category');
30 $dbh->rollback;