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

(-)a/t/Koha/Plugin/Test.pm (+10 lines)
Lines 58-63 sub opac_online_payment_end { Link Here
58
    return "Koha::Plugin::Test::opac_online_payment_end";
58
    return "Koha::Plugin::Test::opac_online_payment_end";
59
}
59
}
60
60
61
sub opac_head {
62
    my ( $self, $args ) = @_;
63
    return "Koha::Plugin::Test::opac_head";
64
}
65
66
sub opac_js {
67
    my ( $self, $args ) = @_;
68
    return "Koha::Plugin::Test::opac_js";
69
}
70
61
sub configure {
71
sub configure {
62
    my ( $self, $args ) = @_;
72
    my ( $self, $args ) = @_;
63
    return "Koha::Plugin::Test::configure";;
73
    return "Koha::Plugin::Test::configure";;
(-)a/t/Koha_Template_Plugin_KohaPlugins.t (+41 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
use Modern::Perl;
4
5
use Test::More tests => 8;
6
use CGI;
7
use File::Basename;
8
use File::Spec;
9
use File::Temp qw( tempdir tempfile );
10
use FindBin qw($Bin);
11
use Archive::Extract;
12
use Module::Load::Conditional qw(can_load);
13
use Test::MockModule;
14
15
use C4::Context;
16
use t::lib::Mocks;
17
18
BEGIN {
19
    push( @INC, dirname(__FILE__) );
20
21
    use_ok('Koha::Plugins');
22
    use_ok('Koha::Plugins::Handler');
23
    use_ok('Koha::Plugins::Base');
24
    use_ok('Koha::Plugin::Test');
25
}
26
27
my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' );
28
$mock_plugin->mock( 'test_template', sub {
29
    my ( $self, $file ) = @_;
30
    my $template = $self->get_template({ file => $file });
31
    $template->param( filename => $file );
32
    return $template->output;
33
});
34
35
use_ok( 'Koha::Template::Plugin::KohaPlugins', 'Can use Koha::Template::Plugin::KohaPlugins' );
36
37
ok( my $plugin = Koha::Template::Plugin::KohaPlugins->new(), 'Able to instantiate template plugin' );
38
39
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' );
40
41
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' );
(-)a/t/db_dependent/Plugins.t (-2 / +3 lines)
Lines 2-8 Link Here
2
2
3
use Modern::Perl;
3
use Modern::Perl;
4
4
5
use Test::More tests => 32;
5
use Test::More tests => 34;
6
use CGI;
6
use CGI;
7
use File::Basename;
7
use File::Basename;
8
use File::Spec;
8
use File::Spec;
Lines 45-50 ok( $plugin->can('to_marc'), 'Test plugin can to_marc' ); Link Here
45
ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' );
45
ok( $plugin->can('opac_online_payment'), 'Test plugin can opac_online_payment' );
46
ok( $plugin->can('opac_online_payment_begin'), 'Test plugin can opac_online_payment_begin' );
46
ok( $plugin->can('opac_online_payment_begin'), 'Test plugin can opac_online_payment_begin' );
47
ok( $plugin->can('opac_online_payment_end'), 'Test plugin can opac_online_payment_end' );
47
ok( $plugin->can('opac_online_payment_end'), 'Test plugin can opac_online_payment_end' );
48
ok( $plugin->can('opac_head'), 'Test plugin can opac_head' );
49
ok( $plugin->can('opac_js'), 'Test plugin can opac_js' );
48
ok( $plugin->can('configure'), 'Test plugin can configure' );
50
ok( $plugin->can('configure'), 'Test plugin can configure' );
49
ok( $plugin->can('install'), 'Test plugin can install' );
51
ok( $plugin->can('install'), 'Test plugin can install' );
50
ok( $plugin->can('uninstall'), 'Test plugin can install' );
52
ok( $plugin->can('uninstall'), 'Test plugin can install' );
51
- 

Return to bug 20181