Lines 25-31
use File::Temp qw( tempdir tempfile );
Link Here
|
25 |
use FindBin qw($Bin); |
25 |
use FindBin qw($Bin); |
26 |
use Module::Load::Conditional qw(can_load); |
26 |
use Module::Load::Conditional qw(can_load); |
27 |
use Test::MockModule; |
27 |
use Test::MockModule; |
28 |
use Test::More tests => 52; |
28 |
use Test::More tests => 51; |
29 |
|
29 |
|
30 |
use C4::Context; |
30 |
use C4::Context; |
31 |
use Koha::Database; |
31 |
use Koha::Database; |
Lines 90-116
subtest 'Version upgrade tests' => sub {
Link Here
|
90 |
$schema->storage->txn_rollback; |
90 |
$schema->storage->txn_rollback; |
91 |
}; |
91 |
}; |
92 |
|
92 |
|
93 |
subtest 'Version upgrade tests' => sub { |
|
|
94 |
|
95 |
plan tests => 1; |
96 |
|
97 |
$schema->storage->txn_begin; |
98 |
|
99 |
my $plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); |
100 |
|
101 |
# make sure there's no version on the DB |
102 |
$schema->resultset('PluginData') |
103 |
->search( { plugin_class => $plugin->{class}, plugin_key => '__INSTALLED_VERSION__' } ) |
104 |
->delete; |
105 |
|
106 |
$plugin = Koha::Plugin::Test->new( { enable_plugins => 1, cgi => CGI->new } ); |
107 |
my $version = $plugin->retrieve_data('__INSTALLED_VERSION__'); |
108 |
|
109 |
is( $version, $plugin->get_metadata->{version}, 'Version has been populated correctly' ); |
110 |
|
111 |
$schema->storage->txn_rollback; |
112 |
}; |
113 |
|
114 |
subtest 'is_enabled() tests' => sub { |
93 |
subtest 'is_enabled() tests' => sub { |
115 |
|
94 |
|
116 |
plan tests => 3; |
95 |
plan tests => 3; |
117 |
- |
|
|