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:
parent
edc49a55bb
commit
ee33d83a25
2 changed files with 24 additions and 29 deletions
14
t/Stats.t
14
t/Stats.t
|
@ -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');
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue