View | Details | Raw Unified | Return to bug 35536
Collapse All | Expand All

(-)a/t/db_dependent/Koha/Plugins/BackgroundJob.t (-1 / +1 lines)
Lines 84-89 subtest 'background_tasks() hooks tests' => sub { Link Here
84
84
85
    is_deeply( $tasks, $bj->core_types_to_classes, 'Only core mapping returned when plugins disabled' );
85
    is_deeply( $tasks, $bj->core_types_to_classes, 'Only core mapping returned when plugins disabled' );
86
86
87
    $schema->storage->txn_rollback;
88
    Koha::Plugins->RemovePlugins;
87
    Koha::Plugins->RemovePlugins;
88
    $schema->storage->txn_rollback;
89
};
89
};
(-)a/t/db_dependent/Koha/Plugins/Barcode_transform_hooks.t (-1 / +1 lines)
Lines 99-104 subtest 'patron_barcode_transform() and item_barcode_transform() hook tests' => Link Here
99
        qr/Plugin error \(Test Plugin\): Exception 'Koha::Exception' thrown 'item_barcode_transform called with parameter: THISISATEST'/,
99
        qr/Plugin error \(Test Plugin\): Exception 'Koha::Exception' thrown 'item_barcode_transform called with parameter: THISISATEST'/,
100
        'Koha::Item->store calls the item_barcode_transform hook';
100
        'Koha::Item->store calls the item_barcode_transform hook';
101
101
102
    $schema->storage->txn_rollback;
103
    Koha::Plugins->RemovePlugins;
102
    Koha::Plugins->RemovePlugins;
103
    $schema->storage->txn_rollback;
104
};
104
};
(-)a/t/db_dependent/Koha/Plugins/Biblio_and_Items_plugin_hooks.t (-1 / +1 lines)
Lines 83-88 subtest 'after_biblio_action() and after_item_action() hooks tests' => sub { Link Here
83
            qr/after_biblio_action called with action: delete, id: $biblio_id/,
83
            qr/after_biblio_action called with action: delete, id: $biblio_id/,
84
            'DelBiblio calls the hook with action=delete biblio_id passed';
84
            'DelBiblio calls the hook with action=delete biblio_id passed';
85
85
86
    $schema->storage->txn_rollback;
87
    Koha::Plugins->RemovePlugins;
86
    Koha::Plugins->RemovePlugins;
87
    $schema->storage->txn_rollback;
88
};
88
};
(-)a/t/db_dependent/Koha/Plugins/Broken.t (-13 / +13 lines)
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;
(-)a/t/db_dependent/Koha/Plugins/Circulation_hooks.t (-1 / +1 lines)
Lines 120-125 subtest 'after_circ_action() hook tests' => sub { Link Here
120
          'AddReturn calls the after_circ_action hook';
120
          'AddReturn calls the after_circ_action hook';
121
    };
121
    };
122
122
123
    $schema->storage->txn_rollback;
124
    Koha::Plugins->RemovePlugins;
123
    Koha::Plugins->RemovePlugins;
124
    $schema->storage->txn_rollback;
125
};
125
};
(-)a/t/db_dependent/Koha/Plugins/Patron.t (-3 / +1 lines)
Lines 87-94 subtest 'check_password hook tests' => sub { Link Here
87
    ok( $patron->set_password({ password => '4321' }), 'Patron password updated with good string' );
87
    ok( $patron->set_password({ password => '4321' }), 'Patron password updated with good string' );
88
    ok( $patron->set_password({ password => 'explosion', skip_validation => 1}), 'Patron password updated via skip validation');
88
    ok( $patron->set_password({ password => 'explosion', skip_validation => 1}), 'Patron password updated via skip validation');
89
89
90
    $schema->storage->txn_rollback;
91
    Koha::Plugins->RemovePlugins;
90
    Koha::Plugins->RemovePlugins;
91
    $schema->storage->txn_rollback;
92
};
92
};
93
94
1;
(-)a/t/db_dependent/Koha/Plugins/authority_hooks.t (-2 / +1 lines)
Lines 65-70 subtest 'after_authority_action hook' => sub { Link Here
65
            qr/after_authority_action called with action: delete, id: $id/,
65
            qr/after_authority_action called with action: delete, id: $id/,
66
            'DelAuthority calls the hook with action=delete, id passed';
66
            'DelAuthority calls the hook with action=delete, id passed';
67
67
68
    $schema->storage->txn_rollback;
69
    Koha::Plugins->RemovePlugins;
68
    Koha::Plugins->RemovePlugins;
69
    $schema->storage->txn_rollback;
70
};
70
};
71
- 

Return to bug 35536