|
Lines 16-22
Link Here
|
| 16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
# along with Koha; if not, see <http://www.gnu.org/licenses>. |
| 17 |
|
17 |
|
| 18 |
use Modern::Perl; |
18 |
use Modern::Perl; |
| 19 |
use Test::More; |
19 |
use Test::More tests => 8; |
| 20 |
|
20 |
|
| 21 |
use File::Temp; |
21 |
use File::Temp; |
| 22 |
use File::Path qw/make_path/; |
22 |
use File::Path qw/make_path/; |
|
Lines 25-52
use t::lib::Mocks;
Link Here
|
| 25 |
|
25 |
|
| 26 |
use Module::Load::Conditional qw/check_install/; |
26 |
use Module::Load::Conditional qw/check_install/; |
| 27 |
|
27 |
|
| 28 |
BEGIN { |
28 |
use_ok('C4::XSLT'); |
| 29 |
if ( check_install( module => 'Test::DBIx::Class' ) ) { |
|
|
| 30 |
plan tests => 10; |
| 31 |
} else { |
| 32 |
plan skip_all => "Need Test::DBIx::Class" |
| 33 |
} |
| 34 |
|
| 35 |
use_ok('C4::XSLT'); |
| 36 |
}; |
| 37 |
|
| 38 |
use Test::DBIx::Class { |
| 39 |
schema_class => 'Koha::Schema', |
| 40 |
connect_info => ['dbi:SQLite:dbname=:memory:','',''], |
| 41 |
connect_opts => { name_sep => '.', quote_char => '`', }, |
| 42 |
fixture_class => '::Populate', |
| 43 |
}, 'Branch' ; |
| 44 |
|
| 45 |
fixtures_ok [ |
| 46 |
Branch => [ |
| 47 |
], |
| 48 |
]; |
| 49 |
|
| 50 |
|
29 |
|
| 51 |
my $dir = File::Temp->newdir(); |
30 |
my $dir = File::Temp->newdir(); |
| 52 |
my @themes = ('prog', 'test'); |
31 |
my @themes = ('prog', 'test'); |
|
Lines 81-89
is(find_and_slurp($dir, 'prog', 'es-ES'), 'Theme prog, language es-ES', 'Found t
Link Here
|
| 81 |
is(find_and_slurp($dir, 'test', 'fr-FR'), 'Theme test, language en', 'Fell back to test/en for test/fr-FR'); |
60 |
is(find_and_slurp($dir, 'test', 'fr-FR'), 'Theme test, language en', 'Fell back to test/en for test/fr-FR'); |
| 82 |
is(find_and_slurp($dir, 'nope', 'es-ES'), 'Theme prog, language es-ES', 'Fell back to prog/es-ES for nope/es-ES'); |
61 |
is(find_and_slurp($dir, 'nope', 'es-ES'), 'Theme prog, language es-ES', 'Fell back to prog/es-ES for nope/es-ES'); |
| 83 |
is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell back to prog/en for nope/fr-FR'); |
62 |
is(find_and_slurp($dir, 'nope', 'fr-FR'), 'Theme prog, language en', 'Fell back to prog/en for nope/fr-FR'); |
| 84 |
|
|
|
| 85 |
my $matching_string = q{<syspref name="singleBranchMode">0</syspref>}; |
| 86 |
my $sysprefs_xml = C4::XSLT::get_xslt_sysprefs(); |
| 87 |
ok( $sysprefs_xml =~ m/$matching_string/, 'singleBranchMode has a value of 0'); |
| 88 |
|
| 89 |
1; |