|
|
@ -3,9 +3,10 @@ |
|
|
|
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; |
|
|
@ -38,4 +39,19 @@ my $metadata = $plugin->get_metadata(); |
|
|
|
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()' ); |
|
|
|
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." ); |
|
|
|