Bug 21846: Regression tests for add_tag_approval
[koha.git] / t / Koha_Template_Plugin_Koha.t
index e22e0d8..e0e5ed2 100644 (file)
@@ -30,15 +30,15 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub {
 
     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";
     });
 
@@ -52,6 +52,7 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub {
     my $res = Koha::Template::Plugin::Koha::Version( $version );
     is_deeply( $res, {
         major       => $major,
+        minor       => $minor,
         release     => $major . "." . $minor,
         maintenance => $major . "." . $minor . "." . $maintenance,
         development => $development
@@ -67,6 +68,7 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub {
     $res = Koha::Template::Plugin::Koha::Version( $version );
     is_deeply( $res, {
         major       => $major,
+        minor       => $minor,
         release     => $major . "." . $minor,
         maintenance => $major . "." . $minor . "." . $maintenance,
         development => undef
@@ -74,4 +76,3 @@ subtest "Koha::Template::Plugin::Koha::Version tests" => sub {
 
 };
 
-1;