Lines 19-26
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use CGI; |
20 |
use CGI; |
21 |
|
21 |
|
22 |
use Test::More tests => 5; |
22 |
use Test::More tests => 6; |
23 |
use Test::Deep; |
23 |
use Test::Deep; |
|
|
24 |
use Test::MockModule; |
25 |
|
26 |
use t::lib::Mocks; |
24 |
|
27 |
|
25 |
BEGIN { |
28 |
BEGIN { |
26 |
use_ok( 'C4::Templates' ); |
29 |
use_ok( 'C4::Templates' ); |
Lines 45-49
is( scalar @keys, 6, "GetColumnDefs correctly returns the 5 tables defined in co
Link Here
|
45 |
my @tables = ( 'biblio', 'biblioitems', 'borrowers', 'items', 'statistics', 'subscription'); |
48 |
my @tables = ( 'biblio', 'biblioitems', 'borrowers', 'items', 'statistics', 'subscription'); |
46 |
cmp_deeply( \@keys, \@tables, "GetColumnDefs returns the expected tables"); |
49 |
cmp_deeply( \@keys, \@tables, "GetColumnDefs returns the expected tables"); |
47 |
|
50 |
|
|
|
51 |
subtest 'Testing themelanguage for unique themes (BZ 17982)' => sub { |
52 |
plan tests => 1; |
53 |
|
54 |
t::lib::Mocks::mock_preference('template', 'prog'); |
55 |
my $module_language = Test::MockModule->new('C4::Languages'); |
56 |
$module_language->mock( 'getlanguage', sub { return 'en'; } ); |
57 |
|
58 |
# This only triggers the first uniq but that is sufficient for now |
59 |
cmp_deeply( ( C4::Templates::themelanguage( C4::Context->config('intrahtdocs'), 'about.tt' , 'intranet', 'fake_cgi' ) )[2], [ 'prog' ], 'We only expect one prog here' ); |
60 |
}; |
48 |
|
61 |
|
49 |
1; |
62 |
1; |
50 |
- |
|
|