Bug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication. Replace mock_dbh 1

t/00-load.t already checks if all of the perl modules can be compiled.

The tests deleted in this commit do a duplicate test with t/00-load.t
Hence they have become unnecessary.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Olli-Antti Kivilahti 2017-03-07 19:19:52 +02:00 committed by Jonathan Druart
parent fb3654077f
commit 1985e6e4b3
10 changed files with 6 additions and 121 deletions

View File

@ -31,7 +31,7 @@ use t::lib::Mocks;
=cut
my $context_module = t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
# Loop through the C4:: modules
my $lib = File::Spec->rel2abs('C4');

View File

@ -1,28 +0,0 @@
#!/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 => 1;
use t::lib::Mocks;
BEGIN {
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use_ok('C4::Breeding');
}

View File

@ -9,7 +9,7 @@ use Koha::Schema;
use_ok('C4::Members');
BEGIN {
t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
}
my $dbh = C4::Context->dbh;

View File

@ -1,29 +0,0 @@
#!/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 => 1;
use t::lib::Mocks;
BEGIN {
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use_ok('C4::Message');
}
1;

View File

@ -1,29 +0,0 @@
#!/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 => 1;
use t::lib::Mocks;
BEGIN {
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use_ok('C4::Overdues');
}
1;

View File

@ -22,7 +22,7 @@ use Test::Warn;
use t::lib::Mocks;
BEGIN {
t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
use_ok('Koha::Object');
use_ok('Koha::Patron');
}

View File

@ -1,29 +0,0 @@
#!/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 => 1;
use t::lib::Mocks;
BEGIN {
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use_ok('C4::RotatingCollections');
}
1;

View File

@ -21,7 +21,7 @@ use Test::More tests => 3;
use t::lib::Mocks;
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
use_ok('C4::Search');
can_ok('C4::Search',

View File

@ -29,7 +29,7 @@ use Test::MockModule;
use t::lib::Mocks;
# Mock the DB connexion and C4::Context
my $context = t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
use_ok('Koha::SuggestionEngine');

View File

@ -67,7 +67,7 @@ foreach (sort @keys) {
ok($config = $koha->{config}, 'Getting $koha->{config} ');
# Testing syspref caching
t::lib::Mocks::mock_dbh;
use Test::DBIx::Class;
my $history;