View | Details | Raw Unified | Return to bug 22053
Collapse All | Expand All

(-)a/t/db_dependent/ImportBatch.t (-1 / +2 lines)
Lines 187-193 subtest "RecordsFromMarcPlugin" => sub { Link Here
187
    close $fh;
187
    close $fh;
188
188
189
    t::lib::Mocks::mock_config( 'enable_plugins', 1 );
189
    t::lib::Mocks::mock_config( 'enable_plugins', 1 );
190
    my ( $plugin ) = Koha::Plugins->new->GetPlugins({ metadata => { name => 'MarcFieldValues' } });
190
    t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 );
191
    my ($plugin) = Koha::Plugins->new->GetPlugins({ all => 1, metadata => { name => 'MarcFieldValues' } });
191
    isnt( $plugin, undef, "Plugin found" );
192
    isnt( $plugin, undef, "Plugin found" );
192
    my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' );
193
    my $records = C4::ImportBatch::RecordsFromMarcPlugin( $name, ref $plugin, 'UTF-8' );
193
    is( @$records, 2, 'Two results returned' );
194
    is( @$records, 2, 'Two results returned' );
(-)a/t/db_dependent/Koha/Template/Plugin/KohaPlugins.t (-3 / +12 lines)
Lines 24-29 BEGIN { Link Here
24
    use_ok('Koha::Plugin::Test');
24
    use_ok('Koha::Plugin::Test');
25
}
25
}
26
26
27
t::lib::Mocks::mock_preference( 'UseKohaPlugins', 1 );
28
t::lib::Mocks::mock_config( 'enable_plugins', 1 );
29
30
my $schema = Koha::Database->new->schema;
31
$schema->storage->txn_begin;
32
33
# Enable all plugins
34
my @plugins = Koha::Plugins->new->GetPlugins({ all => 1, class => 'Koha::Plugin::Test' });
35
map { $_->enable; } @plugins;
36
27
my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' );
37
my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' );
28
$mock_plugin->mock( 'test_template', sub {
38
$mock_plugin->mock( 'test_template', sub {
29
    my ( $self, $file ) = @_;
39
    my ( $self, $file ) = @_;
Lines 36-43 use_ok( 'Koha::Template::Plugin::KohaPlugins', 'Can use Koha::Template::Plugin:: Link Here
36
46
37
ok( my $plugin = Koha::Template::Plugin::KohaPlugins->new(), 'Able to instantiate template plugin' );
47
ok( my $plugin = Koha::Template::Plugin::KohaPlugins->new(), 'Able to instantiate template plugin' );
38
48
39
t::lib::Mocks::mock_preference('UseKohaPlugins',1);
40
t::lib::Mocks::mock_config('enable_plugins',1);
41
ok( index( $plugin->get_plugins_opac_js, 'Koha::Plugin::Test::opac_js' ) != -1, 'Test plugin opac_js return value is part of code returned by get_plugins_opac_js' );
49
ok( index( $plugin->get_plugins_opac_js, 'Koha::Plugin::Test::opac_js' ) != -1, 'Test plugin opac_js return value is part of code returned by get_plugins_opac_js' );
42
ok( index( $plugin->get_plugins_opac_head, 'Koha::Plugin::Test::opac_head' ) != -1, 'Test plugin opac_head return value is part of code returned by get_plugins_opac_head' );
50
ok( index( $plugin->get_plugins_opac_head, 'Koha::Plugin::Test::opac_head' ) != -1, 'Test plugin opac_head return value is part of code returned by get_plugins_opac_head' );
43
ok( index( $plugin->get_plugins_intranet_js, 'Koha::Plugin::Test::intranet_js' ) != -1, 'Test plugin intranet_js return value is part of code returned by get_plugins_intranet_js' );
51
ok( index( $plugin->get_plugins_intranet_js, 'Koha::Plugin::Test::intranet_js' ) != -1, 'Test plugin intranet_js return value is part of code returned by get_plugins_intranet_js' );
Lines 49-51 is( $plugin->get_plugins_opac_js, q{}, 'Test plugin opac_js return value is empt Link Here
49
is( $plugin->get_plugins_opac_head, q{}, 'Test plugin opac_head return value is empty' );
57
is( $plugin->get_plugins_opac_head, q{}, 'Test plugin opac_head return value is empty' );
50
is( $plugin->get_plugins_intranet_js, q{}, 'Test plugin intranet_js return value is empty' );
58
is( $plugin->get_plugins_intranet_js, q{}, 'Test plugin intranet_js return value is empty' );
51
is( $plugin->get_plugins_intranet_head, q{}, 'Test plugin intranet_head return value is empty' );
59
is( $plugin->get_plugins_intranet_head, q{}, 'Test plugin intranet_head return value is empty' );
52
- 
60
61
$schema->storage->txn_rollback;

Return to bug 22053