Bugzilla – Attachment 148393 Details for
Bug 32775
Ordering when there are multiple languages within a language group is wrong
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 32775: (follow-up) Unit tests
Bug-32775-follow-up-Unit-tests.patch (text/plain), 2.23 KB, created by
Fridolin Somers
on 2023-03-18 03:00:47 UTC
(
hide
)
Description:
Bug 32775: (follow-up) Unit tests
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2023-03-18 03:00:47 UTC
Size:
2.23 KB
patch
obsolete
>From 55a56369a5d0f102b156b708da683cfef6fb40df Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 13 Feb 2023 01:39:51 +0000 >Subject: [PATCH] Bug 32775: (follow-up) Unit tests > >Test plan: >1. Apply this patch and restart services >2. Run t/db_dependent/Languages.t >3. Notice tests 16 and 17 sometimes fail >4. Apply all the other patches and restart services >5. Run t/db_dependent/Languages.t >6. Notice all tests consistently pass > >Sponsored-by: Kinder library, New Zealand >Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> >--- > t/db_dependent/Languages.t | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/Languages.t b/t/db_dependent/Languages.t >index f9e50aade8..d654a80790 100755 >--- a/t/db_dependent/Languages.t >+++ b/t/db_dependent/Languages.t >@@ -5,7 +5,7 @@ > > use Modern::Perl; > >-use Test::More tests => 18; >+use Test::More tests => 21; > use List::Util qw(first); > use Data::Dumper; > use Test::Warn; >@@ -24,6 +24,7 @@ isnt(C4::Languages::_get_themes(), undef, 'testing _get_themes doesnt return und > > ok(C4::Languages::_get_language_dirs(), 'test getting _get_language_dirs'); > >+ > my $result; > warning_is { $result = C4::Languages::accept_language(); } > q{accept_language(x,y) called with no clientPreferences (x).}, >@@ -62,6 +63,16 @@ my @currentcheck2 = map { $_->{current} } @$translatedlanguages2; > $onlyzeros = first { $_ != 0 } @currentcheck2; > ok($onlyzeros, "There is a $onlyzeros\n"); > >+# Bug 32775 >+my @languages = ('de-DE', 'en', 'en-NZ', 'mi-NZ'); >+my @enabledlanguages = ('de-DE', 'en-NZ', 'mi-NZ'); >+my $translatedlanguages3; >+$translatedlanguages3 = C4::Languages::_build_languages_arrayref(\@languages,'en',\@enabledlanguages); >+is( $translatedlanguages3->[0]->{rfc4646_subtag}, 'de-DE', '_build_languages_arrayref() returns first language of "de-DE"' ); >+is( $translatedlanguages3->[1]->{rfc4646_subtag}, 'en', '_build_languages_arrayref() returns second language of "en"'); >+is( $translatedlanguages3->[2]->{rfc4646_subtag}, 'mi-NZ', '_build_languages_arrayref() returns third language of "mi-NZ"'); >+ >+ > # Language Descriptions > my $sth = $dbh->prepare("SELECT DISTINCT subtag,type,lang,description from language_descriptions;"); > $sth->execute(); >-- >2.39.0
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 32775
:
145918
|
145919
|
145983
|
145984
|
145996
|
145997
|
145998
|
146194
|
146195
|
146196
|
146569
|
146570
|
146571
|
146572
|
146573
|
146574
|
146575
|
146576
|
148392
| 148393 |
148394
|
148395
|
148396
|
148397