|
Lines 47-58
BEGIN {
Link Here
|
| 47 |
my $schema = Koha::Database->new->schema; |
47 |
my $schema = Koha::Database->new->schema; |
| 48 |
|
48 |
|
| 49 |
subtest 'call() tests' => sub { |
49 |
subtest 'call() tests' => sub { |
| 50 |
plan tests => 2; |
50 |
plan tests => 3; |
| 51 |
|
51 |
|
| 52 |
$schema->storage->txn_begin; |
52 |
$schema->storage->txn_begin; |
| 53 |
# Temporarily remove any installed plugins data |
53 |
# Temporarily remove any installed plugins data |
| 54 |
Koha::Plugins::Methods->delete; |
54 |
Koha::Plugins::Methods->delete; |
| 55 |
|
55 |
|
|
|
56 |
t::lib::Mocks::mock_config('enable_plugins', 1); |
| 56 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
57 |
my $plugins = Koha::Plugins->new({ enable_plugins => 1 }); |
| 57 |
my @plugins = $plugins->InstallPlugins; |
58 |
my @plugins = $plugins->InstallPlugins; |
| 58 |
foreach my $plugin (@plugins) { |
59 |
foreach my $plugin (@plugins) { |
|
Lines 70-75
subtest 'call() tests' => sub {
Link Here
|
| 70 |
$expected = [ { error => 0 } ]; |
71 |
$expected = [ { error => 0 } ]; |
| 71 |
is_deeply(\@responses, $expected, 'call() should return all responses from plugins'); |
72 |
is_deeply(\@responses, $expected, 'call() should return all responses from plugins'); |
| 72 |
|
73 |
|
|
|
74 |
t::lib::Mocks::mock_config('enable_plugins', 0); |
| 75 |
@responses = Koha::Plugins->call('check_password', { password => '1234' }); |
| 76 |
is_deeply(\@responses, [], 'call() should return an empty array if plugins are disabled'); |
| 77 |
|
| 73 |
$schema->storage->txn_rollback; |
78 |
$schema->storage->txn_rollback; |
| 74 |
}; |
79 |
}; |
| 75 |
|
80 |
|
|
Lines 352-356
subtest 'new() tests' => sub {
Link Here
|
| 352 |
is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); |
357 |
is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); |
| 353 |
}; |
358 |
}; |
| 354 |
|
359 |
|
| 355 |
$schema->storage->txn_rollback; |
|
|
| 356 |
Koha::Plugins::Methods->delete; |
360 |
Koha::Plugins::Methods->delete; |
| 357 |
- |
|
|