|
Lines 333-345
subtest 'RemovePlugins' => sub {
Link Here
|
| 333 |
Koha::Plugins::Method->new( { plugin_class => "$class_basename$i", plugin_method => "testmr$i" } )->store; |
333 |
Koha::Plugins::Method->new( { plugin_class => "$class_basename$i", plugin_method => "testmr$i" } )->store; |
| 334 |
|
334 |
|
| 335 |
# no_auto => 1 here prevents loading of a not-existing module |
335 |
# no_auto => 1 here prevents loading of a not-existing module |
| 336 |
$mocks->[$i] = Test::MockModule->new( "$class_basename$i", no_auto => 1 )->mock( new => 1 ) |
336 |
unless ( $mocks->[$i] ) { |
| 337 |
unless $mocks->[$i]; |
337 |
$mocks->[$i] = Test::MockModule->new( "$class_basename$i", no_auto => 1 ); |
|
|
338 |
$mocks->[$i]->mock( new => 1 ); |
| 339 |
} |
| 338 |
} |
340 |
} |
| 339 |
|
341 |
|
| 340 |
# We will (re)create new plugins (without modules) |
342 |
# We will (re)create new plugins (without modules) |
| 341 |
# This requires mocking can_load from Module::Load::Conditional |
343 |
# This requires mocking can_load from Module::Load::Conditional |
| 342 |
my $mlc_mock = Test::MockModule->new('Koha::Plugins')->mock( can_load => 1 ); |
344 |
my $mlc_mock = Test::MockModule->new('Koha::Plugins'); |
|
|
345 |
$mlc_mock->mock( can_load => 1 ); |
| 343 |
my $plugin_mocks = []; |
346 |
my $plugin_mocks = []; |
| 344 |
my @enabled_plugins; |
347 |
my @enabled_plugins; |
| 345 |
|
348 |
|
| 346 |
- |
|
|