Bug 18226 - Remove "use Test::DBIx::Class" instantiations' dangerous code duplication...
authorOlli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Tue, 7 Mar 2017 17:19:52 +0000 (19:19 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 5 Jun 2017 20:52:47 +0000 (17:52 -0300)
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>

t/00-load.t
t/Breeding.t [deleted file]
t/Members/cardnumber.t
t/Message.t [deleted file]
t/Overdues.t [deleted file]
t/Patron.t
t/RotatingCollections.t [deleted file]
t/Search.t
t/SuggestionEngine_AuthorityFile.t
t/db_dependent/Context.t

index 36a5bcf..460018c 100644 (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');
diff --git a/t/Breeding.t b/t/Breeding.t
deleted file mode 100755 (executable)
index 6effd9f..0000000
+++ /dev/null
@@ -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');
-}
-
index af3a4bb..f2f7882 100644 (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;
diff --git a/t/Message.t b/t/Message.t
deleted file mode 100755 (executable)
index dc63832..0000000
+++ /dev/null
@@ -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;
diff --git a/t/Overdues.t b/t/Overdues.t
deleted file mode 100755 (executable)
index f0d8a8c..0000000
+++ /dev/null
@@ -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;
index c32de10..be66f9d 100755 (executable)
@@ -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');
 }
diff --git a/t/RotatingCollections.t b/t/RotatingCollections.t
deleted file mode 100755 (executable)
index 618703e..0000000
+++ /dev/null
@@ -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;
index 5618ead..5c35419 100755 (executable)
@@ -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',
index ef6eb42..96ca44d 100755 (executable)
@@ -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');
 
index bce0cef..9325c72 100755 (executable)
@@ -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;