Bugzilla – Attachment 26614 Details for
Bug 11906
Bad display of utf-8 chars in Patron lists (Datatable)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12001: regression test for using DBIC to store & fetch UTF8 strings
Bug-12001-regression-test-for-using-DBIC-to-store-.patch (text/plain), 1.94 KB, created by
Galen Charlton
on 2014-03-26 20:47:43 UTC
(
hide
)
Description:
Bug 12001: regression test for using DBIC to store & fetch UTF8 strings
Filename:
MIME Type:
Creator:
Galen Charlton
Created:
2014-03-26 20:47:43 UTC
Size:
1.94 KB
patch
obsolete
>From 7005ab39062b69c3d07bd401b8c7a00a4e3c78e6 Mon Sep 17 00:00:00 2001 >From: Galen Charlton <gmc@esilibrary.com> >Date: Wed, 26 Mar 2014 20:26:26 +0000 >Subject: [PATCH] Bug 12001: regression test for using DBIC to store & fetch > UTF8 strings > >This patch adds a regression test for verifying that a >DBIx::Class schema object initialized by Koha database sets up >the database connection to correct store and retrieve UTF8 >values as Perl utf8 strings. > >To test: > >[1] Apply this patch. >[2] Run prove -v t/db_dependent/Koha_Database.t >[3] The test should fail. >[4] Apply the main patch for this bug, then do step 2 again. >[5] The test should pass. > >Signed-off-by: Galen Charlton <gmc@esilibrary.com> > >http://bugs.koha-community.org/show_bug.cgi?id=11906 >--- > t/db_dependent/Koha_Database.t | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Koha_Database.t b/t/db_dependent/Koha_Database.t >index a030078..197501c 100644 >--- a/t/db_dependent/Koha_Database.t >+++ b/t/db_dependent/Koha_Database.t >@@ -1,10 +1,10 @@ > #!/usr/bin/perl > # > >-use strict; >-use warnings; >+use Modern::Perl; >+use utf8; > >-use Test::More tests => 9; >+use Test::More tests => 10; > > BEGIN { > use_ok('Koha::Database'); >@@ -25,3 +25,19 @@ ok( $new_schema = $database->new_schema(), 'Try to get a new schema' ); > ok( $database->set_schema($new_schema), 'Switch to new schema' ); > ok( $database->restore_schema(), 'Switch back' ); > >+# run in a transaction >+$schema->storage->txn_begin(); >+ >+# clear the way >+$schema->resultset('Category')->search({ categorycode => 'GIFT-RUS' })->delete; >+my $gift = 'подаÑок'; >+$schema->resultset('Category')->create({ >+ categorycode => 'GIFT-RUS', >+ description => $gift, >+}); >+my $desc = $schema->resultset('Category')->search({ >+ categorycode => 'GIFT-RUS', >+})->single->get_column('description'); >+is($desc, $gift, 'stored and retrieved UTF8 string'); >+$schema->storage->txn_rollback(); >+ >-- >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 11906
:
25916
|
26614
|
26615
|
26616
|
26617
|
26622
|
26623
|
26624