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

(-)a/t/db_dependent/Koha/Plugins/Overdues.t (-1 / +4 lines)
Lines 17-23 Link Here
17
use Modern::Perl;
17
use Modern::Perl;
18
18
19
use Test::NoWarnings;
19
use Test::NoWarnings;
20
use Test::More tests => 6;
20
use Test::More tests => 9;
21
21
22
use C4::Overdues qw(CalcFine);
22
use C4::Overdues qw(CalcFine);
23
23
Lines 34-39 BEGIN { Link Here
34
    use_ok('C4::Overdues');
34
    use_ok('C4::Overdues');
35
    use_ok('Koha::Plugins');
35
    use_ok('Koha::Plugins');
36
    use_ok('Koha::Plugins::Handler');
36
    use_ok('Koha::Plugins::Handler');
37
    use_ok('Koha::Plugin::CalcFineEmpty');
38
    use_ok('Koha::Plugin::CalcFineNotEmpty');
39
    use_ok('Koha::Plugin::CalcFineBadValue');
37
    use_ok('Koha::Plugin::Test');
40
    use_ok('Koha::Plugin::Test');
38
}
41
}
39
42
(-)a/t/lib/plugins/Koha/Plugin/CalcFineBadValue.pm (+34 lines)
Line 0 Link Here
1
package Koha::Plugin::CalcFineBadValue;
2
3
use Modern::Perl;
4
5
use base qw(Koha::Plugins::Base);
6
7
our $VERSION  = "0.0.1";
8
our $metadata = {
9
    name            => 'Calc Fine Plugin',
10
    author          => 'Kyle M Hall',
11
    description     => 'Test plugin',
12
    date_authored   => '2013-01-14',
13
    date_updated    => '2013-01-14',
14
    minimum_version => '3.11',
15
    maximum_version => undef,
16
    version         => $VERSION,
17
    namespace       => 'calc_fine_bad_value',
18
    my_example_tag  => 'find_me',
19
};
20
21
sub new {
22
    my ( $class, $args ) = @_;
23
    $args->{'metadata'} = $metadata;
24
    my $self = $class->SUPER::new($args);
25
    return $self;
26
}
27
28
sub overwrite_calc_fine {
29
    my ( $self, $params ) = @_;
30
31
    return [ "a", "b" ];
32
}
33
34
1;
(-)a/t/lib/plugins/Koha/Plugin/CalcFineEmpty.pm (+34 lines)
Line 0 Link Here
1
package Koha::Plugin::CalcFineEmpty;
2
3
use Modern::Perl;
4
5
use base qw(Koha::Plugins::Base);
6
7
our $VERSION  = "0.0.1";
8
our $metadata = {
9
    name            => 'Calc Fine Plugin',
10
    author          => 'Kyle M Hall',
11
    description     => 'Test plugin',
12
    date_authored   => '2013-01-14',
13
    date_updated    => '2013-01-14',
14
    minimum_version => '3.11',
15
    maximum_version => undef,
16
    version         => $VERSION,
17
    namespace       => 'calc_fine_empty',
18
    my_example_tag  => 'find_me',
19
};
20
21
sub new {
22
    my ( $class, $args ) = @_;
23
    $args->{'metadata'} = $metadata;
24
    my $self = $class->SUPER::new($args);
25
    return $self;
26
}
27
28
sub overwrite_calc_fine {
29
    my ( $self, $params ) = @_;
30
31
    return undef;
32
}
33
34
1;
(-)a/t/lib/plugins/Koha/Plugin/CalcFineNotEmpty.pm (-1 / +33 lines)
Line 0 Link Here
0
- 
1
package Koha::Plugin::CalcFineNotEmpty;
2
3
use Modern::Perl;
4
5
use base qw(Koha::Plugins::Base);
6
7
our $VERSION  = "0.0.1";
8
our $metadata = {
9
    name            => 'Calc Fine Not Empty Plugin',
10
    author          => 'Kyle M Hall',
11
    description     => 'Test plugin',
12
    date_authored   => '2013-01-14',
13
    date_updated    => '2013-01-14',
14
    minimum_version => '3.11',
15
    maximum_version => undef,
16
    version         => $VERSION,
17
    namespace       => 'calc_fine_not_empty',
18
};
19
20
sub new {
21
    my ( $class, $args ) = @_;
22
    $args->{'metadata'} = $metadata;
23
    my $self = $class->SUPER::new($args);
24
    return $self;
25
}
26
27
sub overwrite_calc_fine {
28
    my ( $self, $params ) = @_;
29
30
    return [ 1, 2, 3 ];
31
}
32
33
1;

Return to bug 39405