Bugzilla – Attachment 33783 Details for
Bug 13264
Full stack encoding tests (UTF-8)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED OFF] Bug 13264: Test for utf-8 on authorised values input/display/delete
0003-Bug-13264-Test-for-utf-8-on-authorised-values-input-.patch (text/plain), 4.65 KB, created by
Zeno Tajoli
on 2014-11-21 12:54:11 UTC
(
hide
)
Description:
[SIGNED OFF] Bug 13264: Test for utf-8 on authorised values input/display/delete
Filename:
MIME Type:
Creator:
Zeno Tajoli
Created:
2014-11-21 12:54:11 UTC
Size:
4.65 KB
patch
obsolete
>From 9c92cfb4ab416084fb7e6ce7ff758be6c25ac581 Mon Sep 17 00:00:00 2001 >From: Zeno Tajoli <z.tajoli@cineca.it> >Date: Wed, 19 Nov 2014 21:58:54 +0100 >Subject: [PATCH 3/6] Bug 13264: Test for utf-8 on authorised values > input/display/delete > >This test check utf-8 support on web intranet interface for authorized values. >It test input, search and delete of utf-8 values. >If all OK it destroy values inserted > >Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com> >--- > t/db_dependent/www/auth_values_input_www.t | 112 ++++++++++++++++++++++++++++ > 1 file changed, 112 insertions(+) > create mode 100644 t/db_dependent/www/auth_values_input_www.t > >diff --git a/t/db_dependent/www/auth_values_input_www.t b/t/db_dependent/www/auth_values_input_www.t >new file mode 100644 >index 0000000..ea0f88e >--- /dev/null >+++ b/t/db_dependent/www/auth_values_input_www.t >@@ -0,0 +1,112 @@ >+#!/usr/bin/perl >+ >+# Copyright 2012 C & P Bibliography Services >+# >+# This 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 2 of the License, or (at your option) any later >+# version. >+# >+# This 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, write to the Free Software Foundation, Inc., 59 Temple Place, >+# Suite 330, Boston, MA 02111-1307 USA >+# >+ >+use Modern::Perl; >+use utf8; >+use Test::More; >+use Test::WWW::Mechanize; >+use Data::Dumper; >+use XML::Simple; >+use JSON; >+use File::Basename; >+use File::Spec; >+use POSIX; >+use Encode; >+ >+my $testdir = File::Spec->rel2abs( dirname(__FILE__) ); >+ >+my $koha_conf = $ENV{KOHA_CONF}; >+my $xml = XMLin($koha_conf); >+ >+eval{ >+ use C4::Context; >+}; >+if ($@) { >+ plan skip_all => "Tests skip. You must have a working Context\n"; >+} >+ >+ >+my $user = $ENV{KOHA_USER} || $xml->{config}->{user}; >+my $password = $ENV{KOHA_PASS} || $xml->{config}->{pass}; >+my $intranet = $ENV{KOHA_INTRANET_URL}; >+ >+my $mysql_on = ProgProcesses('mysql'); >+ >+ >+if ($mysql_on < 2) { >+ plan skip_all => "Tests skip. You must start Mysql to do those tests\n"; >+} >+ >+if (not defined $intranet) { >+ plan skip_all => "Tests skip. You must set env. variable KOHA_INTRANET_URL to do tests\n"; >+} >+ >+ >+$intranet =~ s#/$##; >+ >+my $agent = Test::WWW::Mechanize->new( autocheck => 1 ); >+my $jsonresponse; >+ >+# -------------------------------------------------- LOAD RECORD >+ >+$agent->get_ok( "$intranet/cgi-bin/koha/mainpage.pl", 'connect to intranet' ); >+$agent->form_name('loginform'); >+$agent->field( 'password', $password ); >+$agent->field( 'userid', $user ); >+$agent->field( 'branch', '' ); >+$agent->click_ok( '', 'login to staff client' ); >+$agent->get_ok( "$intranet/cgi-bin/koha/mainpage.pl", 'load main page' ); >+ >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl", 'Connect to Authorized values page' ); >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=add_form", 'Open to create a new category' ); >+$agent->form_name('Aform'); >+$agent->field('authorised_value', 'εÏιμεq'); >+$agent->field('lib_opac', 'autdesc2'); >+$agent->field('lib', 'desc1'); >+$agent->field('category', 'å¦åä¼Î¼Î¼'); >+$agent->field('branches', ''); >+$agent->click_ok( '', "Create new auth category and value" ); >+ >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl", 'Return to Authorized values page' ); >+$agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?searchfield=å¦åä¼Î¼Î¼&offset=0", 'Search the values inserted' ); >+my $text = $agent->text() ; >+#Tests on UTF-8 >+ok ( ( length(Encode::encode_utf8($text)) != length($text) ) , 'UTF-8 are multi-byte. Good') ; >+ok ($text =~ m/å¦åä¼Î¼Î¼/, 'UTF-8 (Asia) chars are correctly present. Good'); >+ok ($text =~ m/εÏιμεq/, 'UTF-8 (Greek) chars are correctly present. Good'); >+my @links = $agent->links; >+my $id_to_del =''; >+foreach my $dato (@links){ >+ my $link = $dato->url; >+ if ($link =~ m/op=delete_confirm\&searchfield=å¦åä¼Î¼Î¼/){ >+ $link =~ m/(.*&id=?)(\d{1,})(&.*)/; >+ $id_to_del = $2; >+ last; >+ }; >+} >+if ($id_to_del) { >+ $agent->get_ok( "$intranet/cgi-bin/koha/admin/authorised_values.pl?op=delete_confirmed&searchfield=å¦åä¼Î¼Î¼&id=$id_to_del", 'UTF_8 auth. value deleted' ); >+}else{ >+ ok($id_to_del ne undef, "error, link to delete nor working"); >+} >+ >+done_testing(); >+ >+sub ProgProcesses { >+ return scalar grep /$_[0]/, (split /\n/, `ps -aef`); >+} >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13264
:
33614
|
33703
|
33704
|
33705
|
33743
|
33744
|
33756
|
33757
|
33758
|
33759
|
33760
|
33777
|
33778
|
33779
|
33780
|
33781
|
33782
|
33783
|
33784
|
33785
|
33786
|
33811
|
33812
|
33813
|
33814
|
33815
|
33816
|
33817
|
34110
|
34111
|
34112
|
34113
|
34114
|
34115
|
34116
|
34117
|
34694
|
34766
|
34767
|
34768
|
34769
|
34770
|
34771
|
34772
|
34773
|
34774
|
34775
|
34776
|
34798
|
34799
|
34800
|
34801
|
34802
|
34803
|
34804
|
34805
|
34806
|
34807
|
34808
|
34809
|
34810
|
34811
|
34814
|
35068
|
35069
|
35070
|
35071
|
35072
|
35073
|
35074
|
35075
|
35076
|
35077
|
35078
|
35079
|
35080
|
35081
|
35082
|
35110
|
35111
|
35112
|
35113
|
35114
|
35115
|
35116
|
35117
|
35118
|
35119
|
35120
|
35121
|
35122
|
35123
|
35124