[Koha-bugs] [Bug 13264] Test about UTF-8 (bug 11944)

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Mon Dec 29 12:39:34 CET 2014


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13264

--- Comment #73 from Jonathan Druart <jonathan.druart at biblibre.com> ---
Quick notes:

1/ I had to add a 'b7' branches to remove the following error in koha logs:
manage-marc-import.pl: DBD::mysql::st execute failed: Cannot add or update a
child row: a foreign key constraint fails (`koha_ut`.`items`, CONSTRAINT
`items_ibfk_2` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`)
ON UPDATE CASCADE) at /home/koha/src/C4/Items.pm line 2171.

2/ With the last patches, the tests don't pass:
t/db_dependent/www/search_utf8.t .. 18/64 Error GETing
http://pro.koha-qa.vm/cgi-bin/koha/catalogue/search.pl?idx=kw&q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1&idx=kw&idx=kw&sort_by=relevance:
Internal Server Error at t/db_dependent/www/search_utf8.t line 245.
# Looks like you planned 64 tests but ran 18.
# Looks like your test exited with 255 just after 18.

To make them pass, I need to (manually) revert the Tomas's patch:

diff --git a/t/db_dependent/www/search_utf8.t
b/t/db_dependent/www/search_utf8.t
index be5ac96..12dbc41 100644
--- a/t/db_dependent/www/search_utf8.t
+++ b/t/db_dependent/www/search_utf8.t
@@ -233,7 +233,7 @@ sub test_search{
     $agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search
on intranet");
     $agent->form_number(1);
     $agent->field('idx', 'kw');
-    $agent->field('q', $search_key);
+    $agent->field('q', Encode::encode('UTF-8', $search_key));
     $agent->click();
     my $intra_text = $agent->text() ;
     like( $intra_text, qr|Publisher: $publisher|, );
@@ -241,12 +241,12 @@ sub test_search{
     $agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search
on intranet");
     $agent->form_number(1);
     $agent->field('idx', 'kw');
-    $agent->field('q', $publisher);
+    $agent->field('q', Encode::encode('UTF-8', $publisher));
     $agent->click();
     $intra_text = $agent->text();

     like( $intra_text, qr|Publisher: $publisher|, );
-    my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8( $publisher
);
+    my $expected_base = q|search.pl\?idx=kw&q=| . uri_escape_utf8(
Encode::encode('UTF-8', $publisher ));
     $agent->base_like(qr|$expected_base|, );

     ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text)
) , 'UTF-8 are multi-byte. Goog') ;
@@ -269,7 +269,7 @@ sub test_search{
     $opac_text = $agent->text();

     like( $opac_text, qr|Publisher: $publisher|, );
-    $expected_base = q|opac-search.pl\?idx=&q=| . uri_escape_utf8( $publisher
);
+    $expected_base = q|opac-search.pl\?q=| . uri_escape_utf8( $publisher );
     $agent->base_like(qr|$expected_base|, );

     ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) )
, 'UTF-8 are multi-byte. Goog') ;

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list