From b46ce53c35233e041296c5e685d81885aa75fd30 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 24 Jun 2025 12:21:23 +0200 Subject: [PATCH] Bug 39712: Add tests --- t/Koha/Manual.t | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100755 t/Koha/Manual.t diff --git a/t/Koha/Manual.t b/t/Koha/Manual.t new file mode 100755 index 00000000000..1f9dc539efe --- /dev/null +++ b/t/Koha/Manual.t @@ -0,0 +1,48 @@ +#!/usr/bin/perl + +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::NoWarnings; +use Test::More tests => 2; + +use Koha::Manual; + +subtest 'VueJS components' => sub { + + my $tests = { + q{http://localhost:8081/cgi-bin/koha/erm/agreements} => + q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements}, + q{/koha/erm/agreements} => q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements}, + q{/koha/erm/agreements/add} => + q{https://koha-community.org/manual/25.05/en/html/erm.html#create-an-agreement-record}, + q{/koha/erm/agreements/edit/1} => + q{https://koha-community.org/manual/25.05/en/html/erm.html#create-an-agreement-record}, + q{/koha/erm/agreements?by_expired=true&max_expiration_date=2025-06-24} => + q{https://koha-community.org/manual/25.05/en/html/erm.html#agreements}, + }; + + plan tests => scalar keys %$tests; + + my $language = 'en'; + while ( my ( $refer, $expected ) = each(%$tests) ) { + is( + Koha::Manual::get_url( $refer, $language ), $expected, + sprintf( "%s should link to %s", $refer, $expected ) + ); + } +}; -- 2.34.1