Lines 22-41
use Test::Warn;
Link Here
|
22 |
|
22 |
|
23 |
use File::Basename; |
23 |
use File::Basename; |
24 |
|
24 |
|
25 |
|
|
|
26 |
BEGIN { |
25 |
BEGIN { |
27 |
# Mock pluginsdir before loading Plugins module |
26 |
# Mock pluginsdir before loading Plugins module |
28 |
my $path = dirname(__FILE__) . '/../../../lib/plugins'; |
27 |
my $path = dirname(__FILE__) . '/../../../lib/plugins'; |
29 |
require t::lib::Mocks; |
28 |
require t::lib::Mocks; |
30 |
t::lib::Mocks::mock_config( 'enable_plugins', 1 ); |
29 |
t::lib::Mocks::mock_config( 'enable_plugins', 1 ); |
31 |
t::lib::Mocks::mock_config( 'pluginsdir', $path ); |
30 |
t::lib::Mocks::mock_config( 'pluginsdir', $path ); |
32 |
|
31 |
|
33 |
use_ok('Koha::Plugins'); |
32 |
use_ok('Koha::Plugins'); |
34 |
use_ok('Koha::Plugins::Handler'); |
33 |
use_ok('Koha::Plugins::Handler'); |
35 |
use_ok('Koha::Plugin::Test'); |
34 |
use_ok('Koha::Plugin::Test'); |
36 |
} |
35 |
} |
37 |
|
36 |
|
38 |
my $schema = Koha::Database->new->schema; |
37 |
my $schema = Koha::Database->new->schema; |
39 |
|
38 |
|
40 |
subtest 'template_include_paths' => sub { |
39 |
subtest 'template_include_paths' => sub { |
41 |
plan tests => 1; |
40 |
plan tests => 1; |
Lines 46-57
subtest 'template_include_paths' => sub {
Link Here
|
46 |
Koha::Plugin::Test->new->enable; |
45 |
Koha::Plugin::Test->new->enable; |
47 |
|
46 |
|
48 |
require C4::Templates; |
47 |
require C4::Templates; |
49 |
my $c4_template = C4::Templates::gettemplate('intranet-main.tt', 'intranet'); |
48 |
my $c4_template = C4::Templates::gettemplate( 'intranet-main.tt', 'intranet' ); |
50 |
my $template = $c4_template->{TEMPLATE}; |
49 |
my $template = $c4_template->{TEMPLATE}; |
51 |
my $output = ''; |
50 |
my $output = ''; |
52 |
$template->process(\"[% INCLUDE test.inc %]", {}, \$output) || die $template->error(); |
51 |
$template->process( \"[% INCLUDE test.inc %]", {}, \$output ) || die $template->error(); |
53 |
is($output, 'included content'); |
52 |
is( $output, 'included content' ); |
54 |
|
53 |
|
55 |
$schema->storage->txn_commit; |
54 |
$schema->storage->txn_commit; |
|
|
55 |
|
56 |
#Koha::Plugins::Methods->delete; |
56 |
#Koha::Plugins::Methods->delete; |
57 |
}; |
57 |
}; |