Bug 22600: Set 'commandline' interface appropriately

This patch change Koha::Cron to be a more generic Koha::Script class and
update all commanline driven scripts to use it.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Martin Renvoize 2019-03-28 14:32:05 +00:00 committed by Nick Clemens
parent 125de75517
commit d2e189ca1c
99 changed files with 190 additions and 64 deletions

View file

@ -1,4 +1,4 @@
package Koha::Cron;
package Koha::Script;
# Copyright PTFS Europe 2019
# Copyright 2019 Koha Development Team
@ -22,29 +22,50 @@ use Modern::Perl;
=head1 NAME
Koha::Cron - Koha Cron scripts base class
Koha::Script - Koha scripts base class
=head1 SYNOPSIS
use Koha::Cron;
use Koha::Script
use Koha::Script -cron;
=head1 DESCRIPTION
This class should be used in all cronscripts. It sets the interface and userenv appropriately.
This class should be used in all scripts. It sets the interface and userenv appropriately.
=cut
use C4::Context;
# Set userenv
C4::Context->_new_userenv(1);
C4::Context->set_userenv(
undef, undef, undef, 'CRON', 'CRON', undef,
undef, undef, undef, undef, undef
);
sub import {
my $class = shift;
my @flags = @_;
# Set interface
C4::Context->interface('cron');
C4::Context->_new_userenv(1);
if ( ( $flags[0] || '' ) eq '-cron' ) {
# Set userenv
C4::Context->_new_userenv(1);
C4::Context->set_userenv(
undef, undef, undef, 'CRON', 'CRON', undef,
undef, undef, undef, undef, undef
);
# Set interface
C4::Context->interface('cron');
}
else {
# Set userenv
C4::Context->set_userenv(
undef, undef, undef, 'CLI', 'CLI', undef,
undef, undef, undef, undef, undef
);
# Set interface
C4::Context->interface('commandline');
}
}
=head1 AUTHOR

View file

@ -18,6 +18,7 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
#
use Koha::Script;
use C4::Boolean;
use C4::Context;
use C4::Debug;

View file

@ -12,6 +12,7 @@ BEGIN {
}
# Koha modules used
use Koha::Script;
use C4::Context;
use MARC::File::USMARC;
use MARC::Record;

View file

@ -11,6 +11,7 @@ BEGIN {
}
# Koha modules used
use Koha::Script;
use MARC::Record;
use C4::Context;
use C4::Biblio;

View file

@ -12,6 +12,7 @@ BEGIN {
# Koha modules used
use Koha::Script;
use C4::Context;
use C4::Biblio;
use MARC::Record;

View file

@ -13,6 +13,7 @@ BEGIN {
}
# Koha modules used
use Koha::Script;
use MARC::Record;
use C4::Context;
use C4::Biblio;

View file

@ -8,6 +8,7 @@ use MARC::Record;
use Pod::Usage;
use Time::HiRes qw(gettimeofday);
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::Items;

View file

@ -12,7 +12,7 @@ BEGIN {
}
# Koha modules used
use Koha::Script;
use C4::Context;
use C4::Biblio;

View file

@ -5,6 +5,7 @@ use Getopt::Long;
use Pod::Usage;
use IO::File;
use Koha::Script;
use C4::Biblio;
my ($help, $files);

View file

@ -10,6 +10,7 @@ use warnings;
use File::Find;
use Koha::Script;
use C4::Context;
@ARGV = qw(.) unless @ARGV;

View file

@ -9,6 +9,7 @@ BEGIN {
eval { require "$FindBin::Bin/kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::ImportBatch;
use Getopt::Long;

View file

@ -49,7 +49,7 @@ BEGIN {
use FindBin;
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Biblio;
use C4::Context;
use C4::Letters;

View file

@ -6,7 +6,7 @@ use Getopt::Long;
use Pod::Usage;
use JSON;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Items;

View file

@ -52,7 +52,7 @@ use Modern::Perl;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Circulation;
use C4::Context;
use C4::Log;

View file

@ -29,7 +29,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use Koha::Patrons;
use Date::Calc qw(

View file

@ -10,7 +10,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Koha;
use C4::Context;
use C4::Biblio;

View file

@ -28,7 +28,7 @@ cart_to_shelf.pl cron script to set items with location of CART to original she
use strict;
use warnings;
use Koha::Cron;
use Koha::Script -cron;
use C4::Items qw/ CartToShelf /;
use C4::Log;

View file

@ -21,7 +21,7 @@ use Modern::Perl;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Biblio;
use AnyEvent;

View file

@ -78,7 +78,7 @@ use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;
use Koha::Cron;
use Koha::Script -cron;
use C4::Biblio;
@ -148,7 +148,7 @@ use Carp;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;

View file

@ -34,7 +34,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Search;
use C4::Search::History;

View file

@ -26,7 +26,7 @@ use YAML::Syck;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Log;

View file

@ -95,7 +95,7 @@ use DBI;
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use English qw(-no_match_vars);

View file

@ -28,7 +28,7 @@ BEGIN {
eval { my $lib = "$FindBin::Bin/../kohalib.pl"; require $lib };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
my $help;

View file

@ -2,7 +2,7 @@
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Items;
use C4::Circulation;

View file

@ -5,7 +5,7 @@ use Modern::Perl;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Members;
use Koha::DateUtils;
use Koha::Patrons;

View file

@ -33,7 +33,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Biblio;
use C4::Items;
use Koha::Database;

View file

@ -29,7 +29,7 @@ use utf8;
# can be run as frequently as required
# log messages are appended to logdir/editrace.log
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use Log::Log4perl qw(:easy);
use Koha::Database;

View file

@ -30,7 +30,7 @@ use strict;
use warnings;
use 5.010;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Overdues;
use Getopt::Long;

View file

@ -10,7 +10,7 @@ BEGIN {
}
use CGI qw( utf8 ); # NOT a CGI script, this is just to keep C4::Templates::gettemplate happy
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Debug;
use C4::Letters;

View file

@ -29,7 +29,7 @@ BEGIN {
# cancel all expired hold requests
use Koha::Cron;
use Koha::Script -cron;
use C4::Reserves;
use C4::Log;

View file

@ -15,7 +15,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::HoldsQueue qw(CreateQueue);
use C4::Log;

View file

@ -29,7 +29,7 @@ BEGIN {
# cancel all expired hold requests
use Koha::Cron;
use Koha::Script -cron;
use C4::Reserves;
use C4::Log;

View file

@ -28,7 +28,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Reserves;
use C4::Log;
use Koha::Holds;

View file

@ -31,7 +31,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::ImportBatch;
my ($help, $framework);

View file

@ -26,7 +26,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Members;
use Getopt::Long;

View file

@ -34,7 +34,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Items;
use C4::Circulation qw/LostItem MarkIssueReturned/;

View file

@ -126,7 +126,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Letters;
use C4::Log;

View file

@ -5,7 +5,7 @@ use Getopt::Long;
use Pod::Usage;
use Time::HiRes qw(gettimeofday);
use Koha::Cron;
use Koha::Script -cron;
use C4::AuthoritiesMarc;
use Koha::Authority::MergeRequests;

View file

@ -5,7 +5,7 @@ use Modern::Perl;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Budgets qw( GetBudget );
use C4::Suggestions qw( GetUnprocessedSuggestions );
use Koha::Libraries;

View file

@ -34,7 +34,7 @@ use Text::CSV_XS;
use DateTime;
use DateTime::Duration;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Letters;
use C4::Overdues qw(GetFine GetOverdueMessageTransportTypes parse_overdues_letter);

View file

@ -26,7 +26,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Letters;
use C4::Log;
use Getopt::Long;

View file

@ -29,7 +29,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Suggestions;
use C4::Log;
use C4::Context;

View file

@ -62,7 +62,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Log;
use Koha::Account::Lines;

View file

@ -2,7 +2,7 @@
use strict;
use warnings;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
# this script will remove those older than 5 days

View file

@ -29,7 +29,7 @@ use Modern::Perl;
use Template;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use Time::Local;
use POSIX;

View file

@ -20,7 +20,7 @@
use Modern::Perl;
use Koha::Cron;
use Koha::Script -cron;
use C4::Reports::Guided; # 0.12
use Koha::Reports;
use C4::Context;

View file

@ -28,7 +28,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Debug;
use C4::Serials;

View file

@ -5,7 +5,7 @@ use Modern::Perl;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::UsageStats;
use C4::Log;

View file

@ -24,7 +24,7 @@ use utf8;
use Pod::Usage;
use Getopt::Long;
use Koha::Cron;
use Koha::Script -cron;
use C4::Biblio;
use Koha::Sitemapper;

View file

@ -2,7 +2,7 @@
use Modern::Perl;
use Koha::Cron;
use Koha::Script -cron;
use C4::SocialData;
my $results = C4::SocialData::get_report;

View file

@ -2,7 +2,7 @@
use Modern::Perl;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::SocialData;

View file

@ -37,7 +37,7 @@ BEGIN {
use Date::Calc qw/Date_to_Days/;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Circulation;
use C4::Overdues;

View file

@ -110,7 +110,7 @@ database updates have been performed.").
use Modern::Perl;
use Getopt::Long qw/HelpMessage :config gnu_getopt/;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Letters;
use Koha::StockRotationRotas;

View file

@ -31,7 +31,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
sub usage {

View file

@ -31,7 +31,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Items;
use C4::Letters;

View file

@ -31,7 +31,7 @@ BEGIN {
use Getopt::Long;
use Pod::Usage;
use Koha::Cron;
use Koha::Script -cron;
use C4::Context;
use C4::Biblio;
use C4::Log;

View file

@ -21,6 +21,7 @@ use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use Koha::Patrons;
my ( $help, $surname, $userid, $password, $branchcode, $categorycode, $cardnumber );

View file

@ -22,6 +22,7 @@ use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use C4::Installer;
use C4::Context;

View file

@ -23,6 +23,7 @@ use Modern::Perl;
use Text::CSV;
use Getopt::Long qw(:config no_ignore_case);
use Koha::Script;
use C4::Context;
use Koha::Patrons;

View file

@ -22,6 +22,7 @@ use List::MoreUtils qw(uniq);
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use C4::Auth;
use C4::Context;
use C4::Record;

View file

@ -12,6 +12,7 @@ BEGIN {
eval { require "$FindBin::Bin/kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::Auth;

View file

@ -22,6 +22,7 @@ use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use Koha::Patrons::Import;
my $Import = Koha::Patrons::Import->new();

View file

@ -11,6 +11,7 @@ BEGIN {
eval { require "$FindBin::Bin/kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::Biblio;
use Getopt::Long;

View file

@ -12,6 +12,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Biblio;
sub process {

View file

@ -12,6 +12,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Biblio;
use Getopt::Long;

View file

@ -25,6 +25,7 @@ use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use Koha::Authorities;
use Koha::Authority::Subfields;
use Koha::MetadataRecord::Authority;

View file

@ -26,6 +26,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::Members::Messaging;
use Getopt::Long;

View file

@ -30,6 +30,7 @@ use open OUT => ':encoding(UTF-8)', ':std';
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use C4::Context;
my $dbh = C4::Context->dbh;

View file

@ -26,6 +26,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use Getopt::Long;
use Pod::Usage;

View file

@ -27,6 +27,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::Installer;

View file

@ -30,6 +30,7 @@ use Getopt::Long;
use Pod::Usage;
use YAML;
use Try::Tiny;
use Koha::Script;
use C4::Context;

View file

@ -22,6 +22,7 @@ use Modern::Perl;
use C4::Context;
use C4::Tags;
use Koha::Script;
use Koha::Database;
use Koha::Tags;
use Koha::Tags::Approvals;

View file

@ -20,6 +20,7 @@ use strict;
use warnings;
use 5.010;
use Koha::Script;
use Koha::Indexer::Utils;
use Getopt::Long;

View file

@ -6,6 +6,8 @@
use strict;
use warnings;
use Koha::Script;
use Koha::RecordProcessor;
use Data::Dumper;
use C4::Biblio;

View file

@ -22,6 +22,7 @@ use strict;
use warnings;
$|=1;
use Koha::Script;
use C4::Context;
use C4::Biblio;
use Getopt::Long;

View file

@ -18,6 +18,8 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use Koha::Script;
use C4::Charset qw( SanitizeRecord );
use C4::Context;
use DBI;

View file

@ -17,6 +17,7 @@
use Modern::Perl;
use Koha::Script;
use Koha::Items;
use Koha::Biblioitems;
use Koha::ItemTypes;

View file

@ -28,6 +28,8 @@ BEGIN {
# possible modules to use
use Getopt::Long;
use Koha::Script;
use C4::Context;
use C4::Biblio;
use Pod::Usage;

View file

@ -28,6 +28,8 @@ BEGIN {
# possible modules to use
use Getopt::Long;
use Koha::Script;
use C4::Context;
use C4::Items;
use Pod::Usage;

View file

@ -23,6 +23,7 @@ use Getopt::Long;
use List::MoreUtils qw/uniq/;
use Pod::Usage;
use Koha::Script;
use C4::AuthoritiesMarc qw/AddAuthority DelAuthority GetAuthority merge/;
my ( @authid, $confirm, $delete, $help, $merge, $reference, $renumber, $verbose );

View file

@ -6,6 +6,7 @@ use strict;
#use warnings; FIXME - Bug 2505
# Koha modules used
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::AuthoritiesMarc;

View file

@ -8,6 +8,7 @@ use strict;
use MARC::File::USMARC;
use MARC::Record;
use MARC::Batch;
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::AuthoritiesMarc;

View file

@ -6,6 +6,7 @@ use strict;
#use warnings; FIXME - Bug 2505
# Koha modules used
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::AuthoritiesMarc;

View file

@ -42,6 +42,7 @@ use MARC::File::XML;
use List::MoreUtils qw/uniq/;
use Getopt::Std;
use Koha::Script;
use C4::Context;
use C4::Charset qw/StripNonXmlChars/;
use C4::Biblio;

View file

@ -17,6 +17,7 @@ use MARC::Record;
use MARC::Batch;
use MARC::Charset;
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::Koha;

View file

@ -33,6 +33,7 @@ BEGIN {
# Koha modules used
use MARC::Record;
use Koha::Script;
use C4::Context;
use Getopt::Long;

View file

@ -9,6 +9,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::Items;

View file

@ -2,7 +2,9 @@
use strict;
#use warnings; FIXME - Bug 2505
use C4::Context;
use Koha::Script;
use C4::Context;
use C4::Items;
use C4::Biblio;

View file

@ -31,6 +31,7 @@ use Modern::Perl;
use Getopt::Long;
use Text::CSV;
use Koha::Script;
use C4::Context;
use C4::Biblio;
use C4::Koha qw( GetVariationsOfISBN );

View file

@ -17,6 +17,7 @@
use Modern::Perl;
use Koha::Script;
use C4::Context;
use Getopt::Long;
use Fcntl qw(:flock);

View file

@ -23,6 +23,7 @@
use strict;
use warnings;
use Koha::Script;
use C4::Context;
use C4::AuthoritiesMarc;
use Getopt::Long;

View file

@ -29,6 +29,7 @@ BEGIN {
eval { require "$FindBin::Bin/../kohalib.pl" };
}
use Koha::Script;
use C4::Biblio;
use C4::Context;
use Getopt::Long;

View file

@ -2,7 +2,9 @@
use strict;
#use warnings; FIXME - Bug 2505
use C4::Context;
use Koha::Script;
use C4::Context;
use C4::Items;
use C4::Biblio;

View file

@ -23,6 +23,7 @@ use Modern::Perl;
use Getopt::Long;
use Pod::Usage;
use Koha::Script;
use C4::Biblio;
my @biblios;

View file

@ -22,6 +22,8 @@
use strict;
use warnings;
use Koha::Script;
use C4::Context;
use C4::Items;
use Data::Dumper;

View file

@ -83,6 +83,7 @@ Full documentation.
use autodie;
use Getopt::Long;
use Koha::Script;
use C4::Context;
use Koha::MetadataRecord::Authority;
use Koha::BiblioUtils;

View file

@ -27,6 +27,7 @@ BEGIN {
eval { require "$FindBin::Bin/kohalib.pl" };
}
use Koha::Script;
use C4::Context;
use C4::ImportBatch;
use C4::Matcher;

48
t/Koha/Script.t Normal file
View file

@ -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 <http://www.gnu.org/licenses>.
use Modern::Perl;
use Test::More tests => 3;
BEGIN { use_ok('Koha::Script') }
use C4::Context;
my $userenv = C4::Context->userenv;
is_deeply(
$userenv,
{
'surname' => 'CLI',
'id' => undef,
'flags' => undef,
'cardnumber' => undef,
'firstname' => 'CLI',
'branchname' => undef,
'branchprinter' => undef,
'emailaddress' => undef,
'number' => undef,
'shibboleth' => undef,
'branch' => undef
},
"Context userenv set correctly with no flags"
);
my $interface = C4::Context->interface;
is( $interface, 'commandline', "Context interface set correctly with no flags" );
1;

View file

@ -19,7 +19,7 @@ use Modern::Perl;
use Test::More tests => 3;
BEGIN { use_ok('Koha::Cron') }
BEGIN { use_ok( "Koha::Script", '-cron' ) }
use C4::Context;
@ -39,10 +39,10 @@ is_deeply(
'shibboleth' => undef,
'branch' => undef
},
"Context userenv set correctly"
"Context userenv set correctly with -cron"
);
my $interface = C4::Context->interface;
is($interface, 'cron', "Context interface set correctly");
is( $interface, 'cron', "Context interface set correctly with -cron" );
1;