import rt 3.8.7
[freeside.git] / rt / t / api / currentuser.t
1
2 use strict;
3 use warnings;
4 use RT;
5 use RT::Test tests => 8;
6
7
8 {
9
10 ok (require RT::CurrentUser);
11
12
13 }
14
15 {
16
17 ok (my $cu = RT::CurrentUser->new('root'));
18 ok (my $lh = $cu->LanguageHandle('en-us'));
19 isnt ($lh, undef, '$lh is defined');
20 ok ($lh->isa('Locale::Maketext'));
21 is ($cu->loc('TEST_STRING'), "Concrete Mixer", "Localized TEST_STRING into English");
22 SKIP: {
23     skip "French localization is not enabled", 2
24         unless grep $_ && $_ =~ /^(\*|fr)$/, RT->Config->Get('LexiconLanguages');
25     ok ($lh = $cu->LanguageHandle('fr'));
26     is ($cu->loc('before'), "avant", "Localized TEST_STRING into French");
27 }
28
29
30 }
31
32 1;