Bug 33608: Rearranging Stats.t, removing useless t version

Subtest, modules, license.
The t/Stats.t is as good as empty, can be removed.

Test plan:
Run t/db_dependent/Stats.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Marcel de Rooy 2023-04-26 14:08:18 +02:00 committed by Tomas Cohen Arazi
parent edc49a55bb
commit ee33d83a25
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 24 additions and 29 deletions

View file

@ -1,14 +0,0 @@
#!/usr/bin/perl
#
# This Koha test module is a stub!
# Add more tests here!!!
use strict;
use warnings;
use Test::More tests => 1;
BEGIN {
use_ok('C4::Stats');
}

View file

@ -1,27 +1,35 @@
#!/usr/bin/perl
# Copyright 2013, 2023 Koha Development team
#
# 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 => 1;
use C4::Context;
use C4::Stats qw( UpdateStats );
use Koha::Database;
use Test::More tests => 19;
BEGIN {
use_ok('C4::Stats', qw( UpdateStats ));
}
can_ok(
'C4::Stats',
qw(UpdateStats)
);
my $schema = Koha::Database->new->schema;
$schema->storage->txn_begin;
my $dbh = C4::Context->dbh;
#
# Test UpdateStats
#
subtest 'UpdateStats' => sub {
plan tests => 17;
is (UpdateStats () ,undef, "UpdateStats returns undef if no params");
my $params = {
@ -161,5 +169,6 @@ $sth->execute();
$line = ${ $sth->fetchall_arrayref( {} ) }[0];
is( $line->{location}, undef,
"UpdateStats sets location to NULL if undef is passed in." );
};
# More tests to write!
$schema->storage->txn_rollback;