From 0faf9a1f461848996aa98ca00eb7ebbff382644b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 26 Mar 2019 14:00:09 +0000 Subject: [PATCH] Bug 22577: Add test for Koha::Cron base class --- t/Koha/Cron.t | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 t/Koha/Cron.t diff --git a/t/Koha/Cron.t b/t/Koha/Cron.t new file mode 100644 index 0000000000..4e58d6c150 --- /dev/null +++ b/t/Koha/Cron.t @@ -0,0 +1,45 @@ +#!/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::More tests => 2; + +BEGIN { use_ok('Koha::Cron') } + +use C4::Context; + +my $userenv = C4::Context->userenv; +is_deeply( + $userenv, + { + 'surname' => 'CRON', + 'id' => '-1', + 'flags' => undef, + 'cardnumber' => undef, + 'firstname' => 'CRON', + 'branchname' => undef, + 'branchprinter' => undef, + 'emailaddress' => undef, + 'number' => '-1', + 'shibboleth' => undef, + 'branch' => undef + }, + "Context set correctly" +); + +1; -- 2.20.1