Fix errors on Korean translation files
[koha.git] / t / db_dependent / Templates.t
blobade6f1d11feb348cbb5a4053508cc7125355133b
1 #!/usr/bin/perl
3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # Koha is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with Koha; if not, see <http://www.gnu.org/licenses>.
18 use Modern::Perl;
20 use CGI;
22 use Test::More tests => 5;
23 use Test::Deep;
25 BEGIN {
26 use_ok( 'C4::Templates' );
27 can_ok( 'C4::Templates',
28 qw/ GetColumnDefs
29 getlanguagecookie
30 setlanguagecookie
31 themelanguage
32 gettemplate
33 _get_template_file
34 param
35 output /);
38 my $query = CGI->new();
39 my $columns = C4::Templates::GetColumnDefs( $query );
41 is( ref( $columns ) eq 'HASH', 1, 'GetColumnDefs returns a hashref' );
42 # get the tables names, sorted
43 my @keys = sort keys %$columns;
44 is( scalar @keys, 5, "GetColumnDefs correctly returns the 5 tables defined in columns.def" );
45 my @tables = ( 'biblio', 'biblioitems', 'borrowers', 'items', 'statistics');
46 cmp_deeply( \@keys, \@tables, "GetColumnDefs returns the expected tables");