1 package Koha
::Plugin
::Test
;
3 ## It's good practice to use Modern::Perl
6 use Mojo
::JSON
qw(decode_json);
8 ## Required for all plugins
9 use base
qw(Koha::Plugins::Base);
13 name
=> 'Test Plugin',
14 author
=> 'Kyle M Hall',
15 description
=> 'Test plugin',
16 date_authored
=> '2013-01-14',
17 date_updated
=> '2013-01-14',
18 minimum_version
=> '3.11',
19 maximum_version
=> undef,
21 my_example_tag
=> 'find_me',
24 ## This is the minimum code required for a plugin's 'new' method
25 ## More can be added, but none should be removed
27 my ( $class, $args ) = @_;
28 $args->{'metadata'} = $metadata;
29 my $self = $class->SUPER::new
($args);
34 my ( $self, $args ) = @_;
35 return "Koha::Plugin::Test::report";
39 my ( $self, $args ) = @_;
40 return "Koha::Plugin::Test::tool";
44 my ( $self, $args ) = @_;
45 return "Koha::Plugin::Test::to_marc";
48 sub opac_online_payment
{
49 my ( $self, $args ) = @_;
50 return "Koha::Plugin::Test::opac_online_payment";
53 sub opac_online_payment_begin
{
54 my ( $self, $args ) = @_;
55 return "Koha::Plugin::Test::opac_online_payment_begin";
58 sub opac_online_payment_end
{
59 my ( $self, $args ) = @_;
60 return "Koha::Plugin::Test::opac_online_payment_end";
64 my ( $self, $args ) = @_;
65 return "Koha::Plugin::Test::opac_head";
69 my ( $self, $args ) = @_;
70 return "Koha::Plugin::Test::opac_js";
74 my ( $self, $args ) = @_;
75 return "Koha::Plugin::Test::configure";;
79 my ( $self, $args ) = @_;
80 return "Koha::Plugin::Test::install";
84 my ( $self, $args ) = @_;
85 return "Koha::Plugin::Test::uninstall";
90 $self->output( '¡Hola output!', 'json' );
93 sub test_output_html
{
95 $self->output_html( '¡Hola output_html!' );
103 my ( $self, $args ) = @_;
107 "/patrons/{patron_id}/bother": {
109 "x-mojo-to": "Koha::Plugin::Test#bother",
110 "operationId": "BotherPatron",
115 "description": "Internal patron identifier",
124 "description": "A bothered patron",
129 "description": "If the patron has been bothered",
136 "description": "An error occurred",
141 "description": "An explanation for the error",
148 "x-koha-authorization": {
158 return decode_json
($spec);