Bug 12851: (QA followup) tests should not expect the <order> tag
[koha.git] / t / db_dependent / Category.t
1 #!/usr/bin/perl
2 #
3 # This Koha test module is a stub!
4 # Add more tests here!!!
5
6 use Modern::Perl;
7
8 use Test::More tests => 3;
9
10 use_ok('C4::Category');
11
12 use C4::Context;
13 my $dbh = C4::Context->dbh;
14 $dbh->{RaiseError} = 1;
15 $dbh->{AutoCommit} = 0;
16
17 my $sth=$dbh->prepare('
18     INSERT INTO categories( categorycode, description, enrolmentperiod, enrolmentperioddate, upperagelimit, dateofbirthrequired, enrolmentfee, reservefee, hidelostitems, overduenoticerequired, category_type )
19     VALUES (?,?,?,?,?,?,?,?,?,?,?)
20 ');
21
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' );
26
27 my $match = grep {$_->{categorycode} eq $nonexistent_categorycode } @categories;
28 is( $match, 1, 'all returns the inserted category');
29
30 $dbh->rollback;