Bug 20334: (RM follow-up) Fix test for case insensative filesystems 2
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 9 Oct 2019 14:03:06 +0000 (15:03 +0100)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 9 Oct 2019 14:07:29 +0000 (15:07 +0100)
This patch moves the Elasticsearch/Indexer.t to ElasticSearch/Indexer.t
and thus removes the case directory name collision introduced.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
t/Koha/SearchEngine/ElasticSearch/Indexer.t [new file with mode: 0644]
t/Koha/SearchEngine/Elasticsearch/Indexer.t [deleted file]

diff --git a/t/Koha/SearchEngine/ElasticSearch/Indexer.t b/t/Koha/SearchEngine/ElasticSearch/Indexer.t
new file mode 100644 (file)
index 0000000..17d5e6f
--- /dev/null
@@ -0,0 +1,78 @@
+#!/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 Test::Exception;
+
+use t::lib::Mocks;
+
+use Test::MockModule;
+
+use MARC::Record;
+use Try::Tiny;
+
+use Koha::SearchEngine::Elasticsearch;
+use Koha::SearchEngine::Elasticsearch::Indexer;
+
+subtest '_sanitise_records() tests' => sub {
+    plan tests => 5;
+
+    my $indexer;
+    ok(
+        $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX }),
+        'Creating a new indexer object'
+    );
+
+    my $record1 = MARC::Record->new();
+    $record1->append_fields(
+        MARC::Field->new('999', '', '', 'c' => 1, 'd' => 2)
+    );
+
+    my $record2 = MARC::Record->new();
+    $record2->append_fields(
+        MARC::Field->new('999', '', '', 'c' => 3, 'd' => 4)
+    );
+    my $records = [$record1, $record2];
+
+    my $biblionumbers = [5, 6];
+
+    $indexer->_sanitise_records($biblionumbers, $records);
+
+    is(
+        $record1->subfield('999', 'c'),
+        '5',
+        'First record has 5 in 999c'
+    );
+    is(
+        $record1->subfield('999', 'd'),
+        '5',
+        'First record has 5 in 999d'
+    );
+
+    is(
+        $record2->subfield('999', 'c'),
+        '6',
+        'Second record has 6 in 999c'
+    );
+    is(
+        $record2->subfield('999', 'd'),
+        '6',
+        'Second record has 6 in 999d'
+    );
+};
\ No newline at end of file
diff --git a/t/Koha/SearchEngine/Elasticsearch/Indexer.t b/t/Koha/SearchEngine/Elasticsearch/Indexer.t
deleted file mode 100644 (file)
index 17d5e6f..0000000
+++ /dev/null
@@ -1,78 +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 Test::Exception;
-
-use t::lib::Mocks;
-
-use Test::MockModule;
-
-use MARC::Record;
-use Try::Tiny;
-
-use Koha::SearchEngine::Elasticsearch;
-use Koha::SearchEngine::Elasticsearch::Indexer;
-
-subtest '_sanitise_records() tests' => sub {
-    plan tests => 5;
-
-    my $indexer;
-    ok(
-        $indexer = Koha::SearchEngine::Elasticsearch::Indexer->new({ 'index' => $Koha::SearchEngine::Elasticsearch::BIBLIOS_INDEX }),
-        'Creating a new indexer object'
-    );
-
-    my $record1 = MARC::Record->new();
-    $record1->append_fields(
-        MARC::Field->new('999', '', '', 'c' => 1, 'd' => 2)
-    );
-
-    my $record2 = MARC::Record->new();
-    $record2->append_fields(
-        MARC::Field->new('999', '', '', 'c' => 3, 'd' => 4)
-    );
-    my $records = [$record1, $record2];
-
-    my $biblionumbers = [5, 6];
-
-    $indexer->_sanitise_records($biblionumbers, $records);
-
-    is(
-        $record1->subfield('999', 'c'),
-        '5',
-        'First record has 5 in 999c'
-    );
-    is(
-        $record1->subfield('999', 'd'),
-        '5',
-        'First record has 5 in 999d'
-    );
-
-    is(
-        $record2->subfield('999', 'c'),
-        '6',
-        'Second record has 6 in 999c'
-    );
-    is(
-        $record2->subfield('999', 'd'),
-        '6',
-        'Second record has 6 in 999d'
-    );
-};
\ No newline at end of file