|
Lines 38-52
use Test::More;
Link Here
|
| 38 |
# use FindBin; |
38 |
# use FindBin; |
| 39 |
# use IPC::Open3; |
39 |
# use IPC::Open3; |
| 40 |
|
40 |
|
| 41 |
foreach my $type qw(intranet opac) { |
41 |
print "Testing intranet prog templates\n"; |
| 42 |
my $template_dir = File::Spec->rel2abs("koha-tmpl/$type-tmpl/prog/en/modules"); |
42 |
run_template_test( |
| 43 |
my $include_dir = File::Spec->rel2abs("koha-tmpl/$type-tmpl/prog/en/includes"); |
43 |
'koha-tmpl/intranet-tmpl/prog/en/modules', |
| 44 |
my $template_test = create_template_test($include_dir); |
44 |
'koha-tmpl/intranet-tmpl/prog/en/includes' |
| 45 |
find({ wanted => $template_test, no_chdir => 1 }, $template_dir, $include_dir); |
45 |
); |
| 46 |
} |
46 |
|
|
|
47 |
print "Testing opac bootstrap templates\n"; |
| 48 |
run_template_test( |
| 49 |
'koha-tmpl/opac-tmpl/bootstrap/en/modules', |
| 50 |
'koha-tmpl/opac-tmpl/bootstrap/en/includes' |
| 51 |
); |
| 52 |
|
| 53 |
print "Testing opac prog templates\n"; |
| 54 |
run_template_test( |
| 55 |
'koha-tmpl/opac-tmpl/prog/en/modules', |
| 56 |
'koha-tmpl/opac-tmpl/prog/en/includes' |
| 57 |
); |
| 58 |
|
| 59 |
# TODO add test of opac ccsr templates |
| 47 |
|
60 |
|
| 48 |
done_testing(); |
61 |
done_testing(); |
| 49 |
|
62 |
|
|
|
63 |
sub run_template_test { |
| 64 |
my $template_path = shift; |
| 65 |
my $include_path = shift; |
| 66 |
my $template_dir = File::Spec->rel2abs($template_path); |
| 67 |
my $include_dir = File::Spec->rel2abs($include_path); |
| 68 |
my $template_test = create_template_test($include_dir); |
| 69 |
find( { wanted => $template_test, no_chdir => 1 }, |
| 70 |
$template_dir, $include_dir ); |
| 71 |
} |
| 72 |
|
| 50 |
sub create_template_test { |
73 |
sub create_template_test { |
| 51 |
my $includes = shift; |
74 |
my $includes = shift; |
| 52 |
return sub { |
75 |
return sub { |
| 53 |
- |
|
|