From 858ac9335bfed35a2cca1783ebb247109b36e246 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 6 May 2020 08:50:54 +0100 Subject: [PATCH] Bug 13547: (QA follow-up) Add basic tests --- .../Koha/Template/Plugin/ColumnsSettings.t | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t diff --git a/t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t b/t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t new file mode 100644 index 0000000000..6a9777719f --- /dev/null +++ b/t/db_dependent/Koha/Template/Plugin/ColumnsSettings.t @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +use Modern::Perl; + +use C4::Context; +use Koha::DateUtils; + +use Test::MockModule; +use Test::More tests => 3; +use t::lib::Mocks; + +BEGIN { + use_ok('Koha::Template::Plugin::ColumnsSettings', "Can use Koha::Template::Plugin::ColumnsSettings"); +} + +ok( my $settings = Koha::Template::Plugin::ColumnsSettings->new(), 'Able to instantiate template plugin' ); + +subtest "is_hidden" => sub { + plan tests => 2; + + is( $settings->is_hidden('opac', 'biblio-detail', 'holdingst', 'item_materials'), 1, 'Returns true if the column is hidden'); + is( $settings->is_hidden('opac', 'biblio-detail', 'holdingst', 'item_callnumber'), 0, 'Returns false if the column is not hidden'); +}; + +1; -- 2.20.1