=head2 store_data
-set_data allows a plugin to store key value pairs in the database for future use.
+store_data allows a plugin to store key value pairs in the database for future use.
-usage: $self->set_data({ param1 => 'param1val', param2 => 'param2value' })
+usage: $self->store_data({ param1 => 'param1val', param2 => 'param2value' })
=cut
sub get_template {
my ( $self, $args ) = @_;
- # my $template =
- # C4::Templates->new( my $interface = 'intranet', my $filename = $self->mbf_path( $args->{'file'} ), my $tmplbase = '', my $query = $self->{'cgi'} );
-
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => $self->mbf_path( $args->{'file'} ),
query => $self->{'cgi'},
use strict;
use warnings;
-use Test::More tests => 16;
+use Test::More tests => 20;
use File::Basename;
-
+use FindBin qw($Bin);
+use Archive::Extract;
use Module::Load::Conditional qw(can_load);
use C4::Context;
ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' );
ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' );
-ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' );
\ No newline at end of file
+ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' );
+
+my @plugins = Koha::Plugins->new()->GetPlugins( 'report' );
+ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetPlugins functions correctly" );
+
+my $plugins_dir = C4::Context->config("pluginsdir");
+my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' );
+unless ( $ae->extract( to => $plugins_dir ) ) {
+ warn "ERROR: " . $ae->error;
+}
+use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink');
+$plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1});
+
+ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" );
+Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink" });
+ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." );