From b35df706560daa070cd87411e1b2019b00819acd Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 24 Oct 2022 14:04:07 -0300 Subject: [PATCH] Revert "Bug 15187: (QA follow-up) Add unit test" This reverts commit 058d411643c4b868553b97896fb065cf9870e456. --- t/db_dependent/Koha/Filter/Index880InZebra.t | 74 -------------------- 1 file changed, 74 deletions(-) delete mode 100644 t/db_dependent/Koha/Filter/Index880InZebra.t diff --git a/t/db_dependent/Koha/Filter/Index880InZebra.t b/t/db_dependent/Koha/Filter/Index880InZebra.t deleted file mode 100644 index b96567779b..0000000000 --- a/t/db_dependent/Koha/Filter/Index880InZebra.t +++ /dev/null @@ -1,74 +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 . - -use utf8; -use Modern::Perl; - -use Test::More tests => 1; - -use t::lib::TestBuilder; - -use Koha::Database; -use Koha::RecordProcessor; - -my $schema = Koha::Database->schema(); -my $builder = t::lib::TestBuilder->new(); - -subtest 'Index880InZebra tests' => sub { - - plan tests => 10; - - $schema->storage->txn_begin(); - - # Add a biblio - my $biblio = $builder->build_sample_biblio({ title => 'Pastoral epistles' }); - my $record = $biblio->metadata->record; - - # Add an 880 alternate - $record->append_fields( - MARC::Field->new( '880', '', '', 6 => '245-01', a => '教牧書信' ), - ); - - my @fields_245 = $record->field('245'); - is( @fields_245, 1, 'One title (245) field present before filtering'); - is( $fields_245[0]->subfield('a'), 'Pastoral epistles', 'First 245 contains english title before filtering'); - - my @fields_880 = $record->field('880'); - is( @fields_880, 1, 'One alternate graphic represnetation (880) field present before filtering'); - is( $fields_880[0]->subfield('a'), '教牧書信', 'Alternate graphic represnations contains chinese characters prior to filtering' ); - - my $processor = Koha::RecordProcessor->new( - { - schema => 'MARC', - filters => ['Index880InZebra'], - } - ); - is( ref($processor), 'Koha::RecordProcessor', 'Created record processor with Index880InZebra filter' ); - - my $result = $processor->process( $record ); - is( ref($result), 'MARC::Record', 'It returns a reference to a MARC::Record object' ); - - @fields_245 = $result->field('245'); - is( @fields_245, 2, 'Two title (245) fields present after filtering'); - is( $fields_245[0]->subfield('a'), 'Pastoral epistles', 'First 245 contains english title after filtering'); - is( $fields_245[1]->subfield('a'), '教牧書信', 'Second 245 contains chinese title from 880 after filtering' ); - - @fields_880 = $result->field('880'); - is( @fields_880, 0, 'No alternate graphic represnetation (880) fields present after filtering'); - - $schema->storage->txn_rollback(); -}; -- 2.39.5