From 204bad7b9501d9cb558f597da3f325881ee990b7 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 26 Apr 2023 14:08:18 +0200 Subject: [PATCH] Bug 33608: Rearranging Stats.t, removing useless t version Content-Type: text/plain; charset=utf-8 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 Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize --- t/Stats.t | 14 -------------- t/db_dependent/Stats.t | 39 ++++++++++++++++++++++++--------------- 2 files changed, 24 insertions(+), 29 deletions(-) delete mode 100755 t/Stats.t diff --git a/t/Stats.t b/t/Stats.t deleted file mode 100755 index d56c2c93b6..0000000000 --- a/t/Stats.t +++ /dev/null @@ -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'); -} - diff --git a/t/db_dependent/Stats.t b/t/db_dependent/Stats.t index 117dfbea28..aebcaa99a6 100755 --- a/t/db_dependent/Stats.t +++ b/t/db_dependent/Stats.t @@ -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 . + 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; -- 2.30.2