|
Lines 23-29
use File::Temp qw( tempdir tempfile );
Link Here
|
| 23 |
use FindBin qw($Bin); |
23 |
use FindBin qw($Bin); |
| 24 |
use Module::Load::Conditional qw(can_load); |
24 |
use Module::Load::Conditional qw(can_load); |
| 25 |
use Test::MockModule; |
25 |
use Test::MockModule; |
| 26 |
use Test::More tests => 49; |
26 |
use Test::More tests => 50; |
| 27 |
|
27 |
|
| 28 |
use C4::Context; |
28 |
use C4::Context; |
| 29 |
use Koha::Database; |
29 |
use Koha::Database; |
|
Lines 115-120
Koha::Plugins::Methods->delete;
Link Here
|
| 115 |
Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins(); |
115 |
Koha::Plugins->new( { enable_plugins => 1 } )->InstallPlugins(); |
| 116 |
|
116 |
|
| 117 |
ok( Koha::Plugins::Methods->search( { plugin_class => 'Koha::Plugin::Test' } )->count, 'Test plugin methods added to database' ); |
117 |
ok( Koha::Plugins::Methods->search( { plugin_class => 'Koha::Plugin::Test' } )->count, 'Test plugin methods added to database' ); |
|
|
118 |
is( Koha::Plugins::Methods->search({ plugin_class => 'Koha::Plugin::Test', plugin_method => '_private_sub' })->count, 0, 'Private methods are skipped' ); |
| 118 |
|
119 |
|
| 119 |
my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' ); |
120 |
my $mock_plugin = Test::MockModule->new( 'Koha::Plugin::Test' ); |
| 120 |
$mock_plugin->mock( 'test_template', sub { |
121 |
$mock_plugin->mock( 'test_template', sub { |
|
Lines 286-289
subtest 'new() tests' => sub {
Link Here
|
| 286 |
is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); |
287 |
is( ref($result), 'Koha::Plugins', 'calling new with enable_plugins makes it override the config' ); |
| 287 |
}; |
288 |
}; |
| 288 |
|
289 |
|
| 289 |
$schema->storage->txn_rollback; |
290 |
$schema->storage->txn_rollback; |