Bug 20764: (QA follow-up) Fix path to sample plugins
[koha-equinox.git] / t / lib / Koha / Plugin / Test.pm
1 package Koha::Plugin::Test;
2
3 ## It's good practice to use Modern::Perl
4 use Modern::Perl;
5
6 ## Required for all plugins
7 use base qw(Koha::Plugins::Base);
8
9 our $VERSION = 1.01;
10 our $metadata = {
11     name            => 'Test Plugin',
12     author          => 'Kyle M Hall',
13     description     => 'Test plugin',
14     date_authored   => '2013-01-14',
15     date_updated    => '2013-01-14',
16     minimum_version => '3.11',
17     maximum_version => undef,
18     version         => $VERSION,
19     my_example_tag  => 'find_me',
20 };
21
22 ## This is the minimum code required for a plugin's 'new' method
23 ## More can be added, but none should be removed
24 sub new {
25     my ( $class, $args ) = @_;
26     $args->{'metadata'} = $metadata;
27     my $self = $class->SUPER::new($args);
28     return $self;
29 }
30
31 sub report {
32     my ( $self, $args ) = @_;
33     return "Koha::Plugin::Test::report";
34 }
35
36 sub tool {
37     my ( $self, $args ) = @_;
38     return "Koha::Plugin::Test::tool";
39 }
40
41 sub to_marc {
42     my ( $self, $args ) = @_;
43     return "Koha::Plugin::Test::to_marc";
44 }
45
46 sub opac_online_payment {
47     my ( $self, $args ) = @_;
48     return "Koha::Plugin::Test::opac_online_payment";
49 }
50
51 sub opac_online_payment_begin {
52     my ( $self, $args ) = @_;
53     return "Koha::Plugin::Test::opac_online_payment_begin";
54 }
55
56 sub opac_online_payment_end {
57     my ( $self, $args ) = @_;
58     return "Koha::Plugin::Test::opac_online_payment_end";
59 }
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
71 sub configure {
72     my ( $self, $args ) = @_;
73     return "Koha::Plugin::Test::configure";;
74 }
75
76 sub install {
77     my ( $self, $args ) = @_;
78     return "Koha::Plugin::Test::install";
79 }
80
81 sub uninstall {
82     my ( $self, $args ) = @_;
83     return "Koha::Plugin::Test::uninstall";
84 }
85
86 sub test_output {
87     my ( $self ) = @_;
88     $self->output( '¡Hola output!', 'json' );
89 }
90
91 sub test_output_html {
92     my ( $self ) = @_;
93     $self->output_html( '¡Hola output_html!' );
94 }