Lines 5-11
Link Here
|
5 |
|
5 |
|
6 |
use Modern::Perl; |
6 |
use Modern::Perl; |
7 |
|
7 |
|
8 |
use Test::More tests => 18; |
8 |
use Test::More tests => 21; |
9 |
use List::Util qw(first); |
9 |
use List::Util qw(first); |
10 |
use Data::Dumper; |
10 |
use Data::Dumper; |
11 |
use Test::Warn; |
11 |
use Test::Warn; |
Lines 24-29
isnt(C4::Languages::_get_themes(), undef, 'testing _get_themes doesnt return und
Link Here
|
24 |
|
24 |
|
25 |
ok(C4::Languages::_get_language_dirs(), 'test getting _get_language_dirs'); |
25 |
ok(C4::Languages::_get_language_dirs(), 'test getting _get_language_dirs'); |
26 |
|
26 |
|
|
|
27 |
|
27 |
my $result; |
28 |
my $result; |
28 |
warning_is { $result = C4::Languages::accept_language(); } |
29 |
warning_is { $result = C4::Languages::accept_language(); } |
29 |
q{accept_language(x,y) called with no clientPreferences (x).}, |
30 |
q{accept_language(x,y) called with no clientPreferences (x).}, |
Lines 62-67
my @currentcheck2 = map { $_->{current} } @$translatedlanguages2;
Link Here
|
62 |
$onlyzeros = first { $_ != 0 } @currentcheck2; |
63 |
$onlyzeros = first { $_ != 0 } @currentcheck2; |
63 |
ok($onlyzeros, "There is a $onlyzeros\n"); |
64 |
ok($onlyzeros, "There is a $onlyzeros\n"); |
64 |
|
65 |
|
|
|
66 |
# Bug 32775 |
67 |
my @languages = ('de-DE', 'en', 'en-NZ', 'mi-NZ'); |
68 |
my @enabledlanguages = ('de-DE', 'en-NZ', 'mi-NZ'); |
69 |
my $translatedlanguages3; |
70 |
$translatedlanguages3 = C4::Languages::_build_languages_arrayref(\@languages,'en',\@enabledlanguages); |
71 |
is( $translatedlanguages3->[0]->{rfc4646_subtag}, 'de-DE', '_build_languages_arrayref() returns first language of "de"' ); |
72 |
is( $translatedlanguages3->[1]->{rfc4646_subtag}, 'en', '_build_languages_arrayref() returns second language of "en-NZ"'); |
73 |
is( $translatedlanguages3->[2]->{rfc4646_subtag}, 'mi-NZ', '_build_languages_arrayref() returns third language of "mi-NZ"'); |
74 |
|
75 |
|
65 |
# Language Descriptions |
76 |
# Language Descriptions |
66 |
my $sth = $dbh->prepare("SELECT DISTINCT subtag,type,lang,description from language_descriptions;"); |
77 |
my $sth = $dbh->prepare("SELECT DISTINCT subtag,type,lang,description from language_descriptions;"); |
67 |
$sth->execute(); |
78 |
$sth->execute(); |
68 |
- |
|
|