plan tests => 2;
- # Variables for mocking KOHAVERSION
+ # Variables for mocking Koha::version()
my $major;
my $minor;
my $maintenance;
my $development;
- # Mock C4::Context::KOHAVERSION
- my $context = new Test::MockModule('C4::Context');
- $context->mock( 'KOHAVERSION', sub {
+ # Mock Koha::version()
+ my $koha = new Test::MockModule('Koha');
+ $koha->mock( 'version', sub {
return "$major.$minor.$maintenance.$development";
});
my $res = Koha::Template::Plugin::Koha::Version( $version );
is_deeply( $res, {
major => $major,
+ minor => $minor,
release => $major . "." . $minor,
maintenance => $major . "." . $minor . "." . $maintenance,
development => $development
$res = Koha::Template::Plugin::Koha::Version( $version );
is_deeply( $res, {
major => $major,
+ minor => $minor,
release => $major . "." . $minor,
maintenance => $major . "." . $minor . "." . $maintenance,
development => undef
};
-1;