|
Lines 23-29
use File::Temp qw( tempdir tempfile );
Link Here
|
| 23 |
use FindBin qw($Bin); |
23 |
use FindBin qw($Bin); |
| 24 |
use Module::Load::Conditional qw(can_load); |
24 |
use Module::Load::Conditional qw(can_load); |
| 25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
| 26 |
use Test::More tests => 50; |
26 |
use Test::More tests => 51; |
| 27 |
|
27 |
|
| 28 |
use C4::Context; |
28 |
use C4::Context; |
| 29 |
use Koha::Database; |
29 |
use Koha::Database; |
|
Lines 109-114
subtest 'Version upgrade tests' => sub {
Link Here
|
| 109 |
$schema->storage->txn_rollback; |
109 |
$schema->storage->txn_rollback; |
| 110 |
}; |
110 |
}; |
| 111 |
|
111 |
|
|
|
112 |
subtest 'is_enabled() tests' => sub { |
| 113 |
|
| 114 |
plan tests => 3; |
| 115 |
$schema->storage->txn_begin; |
| 116 |
|
| 117 |
# Make sure there's no previous installs or leftovers on DB |
| 118 |
Koha::Plugins::Methods->delete; |
| 119 |
$schema->resultset('PluginData')->delete; |
| 120 |
|
| 121 |
my $plugin = Koha::Plugin::Test->new({ enable_plugins => 1, cgi => CGI->new }); |
| 122 |
ok( $plugin->is_enabled, 'Plugins enabled by default' ); |
| 123 |
|
| 124 |
# disable |
| 125 |
$plugin->disable; |
| 126 |
ok( !$plugin->is_enabled, 'Calling ->disable disables the plugin' ); |
| 127 |
|
| 128 |
# enable |
| 129 |
$plugin->enable; |
| 130 |
ok( $plugin->is_enabled, 'Calling ->enable enabled the plugin' ); |
| 131 |
|
| 132 |
$schema->storage->txn_rollback; |
| 133 |
}; |
| 134 |
|
| 112 |
$schema->storage->txn_begin; |
135 |
$schema->storage->txn_begin; |
| 113 |
Koha::Plugins::Methods->delete; |
136 |
Koha::Plugins::Methods->delete; |
| 114 |
|
137 |
|
| 115 |
- |
|
|