From 2e4969424c110c5aa955e139c5842499f66e0a52 Mon Sep 17 00:00:00 2001 From: Zeno Tajoli Date: Fri, 21 Nov 2014 13:27:34 +0100 Subject: [PATCH 6/6] [BUG 13264]: Follow up: in opac_utf8.t insert also delete of biblio In previous version of the test opac_utf8.t clears import from resevoir but it doesn't delete record from biblio table in MySQL. This the standard work of the feature, see: http://manual.koha-community.org/3.18/en/catalogtools.html#managestaged Now the script deletes also record on MySQL level. No necessary on Zebra level because it uses a temporaney Zebra index that it is clenaned at the end of the script. --- t/db_dependent/www/opac_utf8.t | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/www/opac_utf8.t b/t/db_dependent/www/opac_utf8.t index aad38de..143a168 100644 --- a/t/db_dependent/www/opac_utf8.t +++ b/t/db_dependent/www/opac_utf8.t @@ -189,10 +189,13 @@ my $webpage = $agent->{content}; $webpage =~ /(.*.*?)(\d{1,})(.*<\/title>)/sx; my $id_batch = $2; +my $id_bib_number = GetBiblionumberFromImport($id_batch); # wait enough time for the indexer sleep 10; + + # -------------------------------------------------- TEST ON OPAC @@ -218,6 +221,8 @@ ok ($text =~ m/学協会. μμ/, 'UTF-8 chars are correctly present. Good'); $agent->get_ok( "$intranet/cgi-bin/koha/tools/manage-marc-import.pl", 'view and clean batch' ); $agent->form_name('clean_batch_'.$id_batch); $agent->click(); +$agent->get_ok( "$intranet/cgi-bin/koha/catalogue/detail.pl?biblionumber=$id_bib_number", 'biblio on intranet' ); +$agent->get_ok( "$intranet/cgi-bin/koha/cataloguing/addbiblio.pl?op=delete&biblionumber=$id_bib_number", 'biblio deleted' ); # clean cleanup(); @@ -260,6 +265,13 @@ sub cleanup { } - - +sub GetBiblionumberFromImport{ + my ( $batch_id) = @_; + use C4::ImportBatch; + my $data = C4::ImportBatch::GetImportRecordsRange($batch_id, '', '', undef, + { order_by => 'import_record_id', order_by_direction => 'DESC' }); + my $biblionumber = $data->[0]->{'matched_biblionumber'}; + + return $biblionumber; +} 1; -- 1.7.10.4