Lines 1-18
Link Here
|
1 |
#!/usr/bin/perl |
1 |
#!/usr/bin/perl |
|
|
2 |
|
3 |
# This file is part of Koha. |
4 |
# |
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. |
9 |
# |
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. |
2 |
# |
14 |
# |
3 |
# This Koha test module is a stub! |
15 |
# You should have received a copy of the GNU General Public License |
4 |
# Add more tests here!!! |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
5 |
|
17 |
|
6 |
use strict; |
18 |
use Modern::Perl; |
7 |
use warnings; |
|
|
8 |
|
19 |
|
9 |
use Test::More tests => 8; |
20 |
use Test::More tests => 8; |
10 |
use File::Temp; |
21 |
use File::Temp; |
11 |
use File::Path qw/make_path/; |
22 |
use File::Path qw/make_path/; |
|
|
23 |
use Test::MockModule; |
24 |
use DBD::Mock; |
12 |
|
25 |
|
13 |
BEGIN { |
26 |
# Mock the DB connexion and C4::Context |
14 |
use_ok('C4::XSLT'); |
27 |
my $context = new Test::MockModule('C4::Context'); |
15 |
} |
28 |
$context->mock( '_new_dbh', sub { |
|
|
29 |
my $dbh = DBI->connect( 'DBI:Mock:', '', '' ) |
30 |
|| die "Cannot create handle: $DBI::errstr\n"; |
31 |
return $dbh; |
32 |
}); |
33 |
|
34 |
use_ok('C4::XSLT'); |
16 |
|
35 |
|
17 |
my $dir = File::Temp->newdir(); |
36 |
my $dir = File::Temp->newdir(); |
18 |
my @themes = ('prog', 'test'); |
37 |
my @themes = ('prog', 'test'); |
Lines 47-49
is(find_and_slurp($dir, 'prog', 'es-ES'), 'Theme prog, language es-ES', 'Found t
Link Here
|
47 |
is(find_and_slurp($dir, 'test', 'fr-FR'), 'Theme test, language en', 'Fell back to test/en for test/fr-FR'); |
66 |
is(find_and_slurp($dir, 'test', 'fr-FR'), 'Theme test, language en', 'Fell back to test/en for test/fr-FR'); |
48 |
is(find_and_slurp($dir, 'nope', 'es-ES'), 'Theme prog, language es-ES', 'Fell back to prog/es-ES for nope/es-ES'); |
67 |
is(find_and_slurp($dir, 'nope', 'es-ES'), 'Theme prog, language es-ES', 'Fell back to prog/es-ES for nope/es-ES'); |
49 |
is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell back to prog/en for nope/fr-FR'); |
68 |
is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell back to prog/en for nope/fr-FR'); |
50 |
- |
69 |
|
|
|
70 |
1; |