Lines 15-29
Link Here
|
15 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
15 |
# with Koha; if not, see <http://www.gnu.org/licenses>. |
16 |
|
16 |
|
17 |
use Modern::Perl; |
17 |
use Modern::Perl; |
18 |
|
|
|
19 |
use Test::More tests => 3; |
20 |
use Test::MockModule; |
21 |
use Test::Warn; |
22 |
|
23 |
use File::Basename; |
18 |
use File::Basename; |
|
|
19 |
use Test::More tests => 2; |
20 |
use Test::Warn; |
24 |
|
21 |
|
25 |
use t::lib::Mocks; |
22 |
use t::lib::Mocks; |
26 |
use t::lib::TestBuilder; |
23 |
|
|
|
24 |
use Koha::Database; |
27 |
|
25 |
|
28 |
BEGIN { |
26 |
BEGIN { |
29 |
# Mock pluginsdir before loading Plugins module |
27 |
# Mock pluginsdir before loading Plugins module |
Lines 31-47
BEGIN {
Link Here
|
31 |
t::lib::Mocks::mock_config( 'pluginsdir', $path ); |
29 |
t::lib::Mocks::mock_config( 'pluginsdir', $path ); |
32 |
|
30 |
|
33 |
use_ok('Koha::Plugins'); |
31 |
use_ok('Koha::Plugins'); |
34 |
use_ok('Koha::Plugins::Handler'); |
|
|
35 |
} |
32 |
} |
36 |
|
33 |
|
37 |
my $schema = Koha::Database->new->schema; |
34 |
my $schema = Koha::Database->new->schema; |
38 |
my $builder = t::lib::TestBuilder->new; |
35 |
$schema->storage->txn_begin; |
39 |
|
36 |
|
40 |
t::lib::Mocks::mock_config( 'enable_plugins', 1 ); |
37 |
t::lib::Mocks::mock_config( 'enable_plugins', 1 ); |
41 |
|
38 |
|
42 |
my $plugins = Koha::Plugins->new; |
39 |
my $plugins = Koha::Plugins->new; |
43 |
|
40 |
|
44 |
warnings_are |
41 |
warnings_are { $plugins->InstallPlugins; } |
45 |
{ $plugins->InstallPlugins; } |
42 |
[ |
46 |
[ "Calling 'install' died for plugin Koha::Plugin::BrokenInstall", |
43 |
"Calling 'install' died for plugin Koha::Plugin::BrokenInstall", |
47 |
"Calling 'upgrade' died for plugin Koha::Plugin::BrokenUpgrade" ]; |
44 |
"Calling 'upgrade' died for plugin Koha::Plugin::BrokenUpgrade" |
|
|
45 |
]; |
46 |
|
47 |
$schema->storage->txn_begin; |