Lines 3-11
Link Here
|
3 |
use strict; |
3 |
use strict; |
4 |
use warnings; |
4 |
use warnings; |
5 |
|
5 |
|
6 |
use Test::More tests => 16; |
6 |
use Test::More tests => 20; |
7 |
use File::Basename; |
7 |
use File::Basename; |
8 |
|
8 |
use FindBin qw($Bin); |
|
|
9 |
use Archive::Extract; |
9 |
use Module::Load::Conditional qw(can_load); |
10 |
use Module::Load::Conditional qw(can_load); |
10 |
|
11 |
|
11 |
use C4::Context; |
12 |
use C4::Context; |
Lines 38-41
my $metadata = $plugin->get_metadata();
Link Here
|
38 |
ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' ); |
39 |
ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' ); |
39 |
|
40 |
|
40 |
ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' ); |
41 |
ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' ); |
41 |
ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' ); |
42 |
ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' ); |
|
|
43 |
|
44 |
my @plugins = Koha::Plugins->new()->GetPlugins( 'report' ); |
45 |
ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetPlugins functions correctly" ); |
46 |
|
47 |
my $plugins_dir = C4::Context->config("pluginsdir"); |
48 |
my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' ); |
49 |
unless ( $ae->extract( to => $plugins_dir ) ) { |
50 |
warn "ERROR: " . $ae->error; |
51 |
} |
52 |
use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink'); |
53 |
$plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1}); |
54 |
|
55 |
ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" ); |
56 |
Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink" }); |
57 |
ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." ); |
42 |
- |
|
|