View | Details | Raw Unified | Return to bug 16502
Collapse All | Expand All

(-)a/t/db_dependent/Plugins.t (-4 / +7 lines)
Lines 3-9 Link Here
3
use strict;
3
use strict;
4
use warnings;
4
use warnings;
5
5
6
use Test::More tests => 21;
6
use Test::More tests => 22;
7
use File::Basename;
7
use File::Basename;
8
use FindBin qw($Bin);
8
use FindBin qw($Bin);
9
use Archive::Extract;
9
use Archive::Extract;
Lines 47-54 ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetP Link Here
47
47
48
SKIP: {
48
SKIP: {
49
    my $plugins_dir = C4::Context->config("pluginsdir");
49
    my $plugins_dir = C4::Context->config("pluginsdir");
50
    skip "plugindir not set", 3 unless defined $plugins_dir;
50
    skip "plugindir not set", 4 unless defined $plugins_dir;
51
    skip "plugindir not writable", 3 unless -w $plugins_dir;
51
    skip "plugindir not writable", 4 unless -w $plugins_dir;
52
    # no need to skip further tests if KitchenSink would already exist
52
    # no need to skip further tests if KitchenSink would already exist
53
53
54
    my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' );
54
    my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' );
Lines 57-64 SKIP: { Link Here
57
    }
57
    }
58
    use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink');
58
    use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink');
59
    $plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1});
59
    $plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1});
60
    my $table = $plugin->get_qualified_table_name( 'mytable' );
60
61
61
    ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" );
62
    ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" );
62
    Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink", enable_plugins => 1 });
63
    Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink", enable_plugins => 1 });
64
    my $sth = C4::Context->dbh->table_info( undef, undef, $table, 'TABLE' );
65
    my $info = $sth->fetchall_arrayref;
66
    is( @$info, 0, "Table $table does no longer exist" );
63
    ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." );
67
    ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." );
64
}
68
}
65
- 

Return to bug 16502