Lines 6-12
Link Here
|
6 |
use strict; |
6 |
use strict; |
7 |
use warnings; |
7 |
use warnings; |
8 |
|
8 |
|
9 |
use Test::More tests => 9; |
9 |
use Test::More tests => 11; |
|
|
10 |
use List::Util qw(first); |
11 |
use Data::Dumper; |
10 |
|
12 |
|
11 |
BEGIN { |
13 |
BEGIN { |
12 |
use_ok('C4::Languages'); |
14 |
use_ok('C4::Languages'); |
Lines 38-41
C4::Context->set_preference('AdvancedSearchLanguages', 'ita|eng');
Link Here
|
38 |
$languages = C4::Languages::getLanguages('eng', 1); |
40 |
$languages = C4::Languages::getLanguages('eng', 1); |
39 |
is(scalar(@$languages), 2, 'getLanguages() filtering using AdvancedSearchLanguages works'); |
41 |
is(scalar(@$languages), 2, 'getLanguages() filtering using AdvancedSearchLanguages works'); |
40 |
|
42 |
|
|
|
43 |
my $translatedlanguages1 = C4::Languages::getTranslatedLanguages('opac','prog',undef,''); |
44 |
my @currentcheck1 = map { $_->{current} } @$translatedlanguages1; |
45 |
my $onlyzeros = first { $_ != 0 } @currentcheck1; |
46 |
ok(! $onlyzeros, "Everything was zeros.\n"); |
47 |
|
48 |
my $translatedlanguages2 = C4::Languages::getTranslatedLanguages('opac','prog','en',''); |
49 |
my @currentcheck2 = map { $_->{current} } @$translatedlanguages2; |
50 |
$onlyzeros = first { $_ != 0 } @currentcheck2; |
51 |
ok($onlyzeros, "There is a $onlyzeros\n"); |
52 |
|
41 |
$dbh->rollback; |
53 |
$dbh->rollback; |
42 |
- |
|
|