Lines 57-64
subtest 'call() tests' => sub {
Link Here
|
57 |
|
57 |
|
58 |
$schema->storage->txn_begin; |
58 |
$schema->storage->txn_begin; |
59 |
# Temporarily remove any installed plugins data |
59 |
# Temporarily remove any installed plugins data |
60 |
Koha::Plugins::Methods->delete; |
60 |
Koha::Plugins->RemovePlugins( { destructive => 1 } ); |
61 |
$schema->resultset('PluginData')->delete(); |
|
|
62 |
|
61 |
|
63 |
t::lib::Mocks::mock_config('enable_plugins', 1); |
62 |
t::lib::Mocks::mock_config('enable_plugins', 1); |
64 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
63 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
Lines 95-102
subtest 'more call() tests' => sub {
Link Here
|
95 |
|
94 |
|
96 |
$schema->storage->txn_begin; |
95 |
$schema->storage->txn_begin; |
97 |
# Temporarily remove any installed plugins data |
96 |
# Temporarily remove any installed plugins data |
98 |
Koha::Plugins::Methods->delete; |
97 |
Koha::Plugins->RemovePlugins( { destructive => 1 } ); |
99 |
$schema->resultset('PluginData')->delete(); |
|
|
100 |
|
98 |
|
101 |
t::lib::Mocks::mock_config('enable_plugins', 1); |
99 |
t::lib::Mocks::mock_config('enable_plugins', 1); |
102 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
100 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
Lines 138-145
subtest 'feature_enabled tests' => sub {
Link Here
|
138 |
$schema->storage->txn_begin; |
136 |
$schema->storage->txn_begin; |
139 |
|
137 |
|
140 |
# Temporarily remove any installed plugins data |
138 |
# Temporarily remove any installed plugins data |
141 |
Koha::Plugins::Methods->delete; |
139 |
Koha::Plugins->RemovePlugins( { destructive => 1 } ); |
142 |
$schema->resultset('PluginData')->delete(); |
|
|
143 |
|
140 |
|
144 |
t::lib::Mocks::mock_config( 'enable_plugins', 0 ); |
141 |
t::lib::Mocks::mock_config( 'enable_plugins', 0 ); |
145 |
my $enabled = Koha::Plugins->feature_enabled('check_password'); |
142 |
my $enabled = Koha::Plugins->feature_enabled('check_password'); |
Lines 169-176
subtest 'GetPlugins() tests' => sub {
Link Here
|
169 |
plan tests => 3; |
166 |
plan tests => 3; |
170 |
|
167 |
|
171 |
$schema->storage->txn_begin; |
168 |
$schema->storage->txn_begin; |
172 |
# Temporarily remove any installed plugins data |
169 |
# Temporarily remove any installed plugins data (FIXME not done) |
173 |
Koha::Plugins::Methods->delete; |
170 |
Koha::Plugins->RemovePlugins; |
174 |
|
171 |
|
175 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
172 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
176 |
|
173 |
|
Lines 215-222
subtest 'is_enabled() tests' => sub {
Link Here
|
215 |
$schema->storage->txn_begin; |
212 |
$schema->storage->txn_begin; |
216 |
|
213 |
|
217 |
# Make sure there's no previous installs or leftovers on DB |
214 |
# Make sure there's no previous installs or leftovers on DB |
218 |
Koha::Plugins::Methods->delete; |
215 |
Koha::Plugins->RemovePlugins( { destructive => 1 } ); |
219 |
$schema->resultset('PluginData')->delete; |
|
|
220 |
|
216 |
|
221 |
my $plugin = Koha::Plugin::Test->new({ enable_plugins => 1, cgi => CGI->new }); |
217 |
my $plugin = Koha::Plugin::Test->new({ enable_plugins => 1, cgi => CGI->new }); |
222 |
ok( $plugin->is_enabled, 'Plugins enabled by default' ); |
218 |
ok( $plugin->is_enabled, 'Plugins enabled by default' ); |
Lines 234-241
subtest 'is_enabled() tests' => sub {
Link Here
|
234 |
|
230 |
|
235 |
subtest 'Koha::Plugin::Test' => sub { |
231 |
subtest 'Koha::Plugin::Test' => sub { |
236 |
$schema->storage->txn_begin; |
232 |
$schema->storage->txn_begin; |
237 |
Koha::Plugins::Methods->delete; |
233 |
Koha::Plugins->RemovePlugins( { destructive => 1 } ); |
238 |
$schema->resultset('PluginData')->delete; |
|
|
239 |
|
234 |
|
240 |
warning_is { Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins(); } undef; |
235 |
warning_is { Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins(); } undef; |
241 |
|
236 |
|