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