3 # This file is part of Koha.
5 # Koha is free software; you can redistribute it and/or modify it under the
6 # terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 3 of the License, or (at your option) any later
10 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with Koha; if not, see <http://www.gnu.org/licenses>.
19 use Test::More tests => 4;
27 # Mock pluginsdir before loading Plugins module
28 my $path = dirname(__FILE__) . '/../../../lib/plugins';
29 require t::lib::Mocks;
30 t::lib::Mocks::mock_config( 'enable_plugins', 1 );
31 t::lib::Mocks::mock_config( 'pluginsdir', $path );
33 use_ok('Koha::Plugins');
34 use_ok('Koha::Plugins::Handler');
35 use_ok('Koha::Plugin::Test');
38 my $schema = Koha::Database->new->schema;
40 subtest 'template_include_paths' => sub {
43 $schema->storage->txn_begin;
45 Koha::Plugins->new->InstallPlugins();
46 Koha::Plugin::Test->new->enable;
48 require C4::Templates;
49 my $c4_template = C4::Templates::gettemplate('intranet-main.tt', 'intranet');
50 my $template = $c4_template->{TEMPLATE};
52 $template->process(\"[% INCLUDE test.inc %]", {}, \$output) || die $template->error();
53 is($output, 'included content');
55 $schema->storage->txn_commit;
56 #Koha::Plugins::Methods->delete;