LEMONLDAP::NG : * Romanian translation update
* perltidy * test for menu
This commit is contained in:
parent
e4a7734f23
commit
5483c4451a
|
@ -104,4 +104,5 @@ t/21-Lemonldap-NG-Portal-AuthSSL.t
|
|||
t/22-Lemonldap-NG-Portal-AuthCAS.t
|
||||
t/23-Lemonldap-NG-Portal-AuthLA.t
|
||||
t/40-Lemonldap-NG-Portal-CDA.t
|
||||
t/50-Lemonldap-NG-Portal-Menu.t
|
||||
t/99-pod.t
|
||||
|
|
|
@ -2,6 +2,7 @@ package Lemonldap::NG::Portal::Menu;
|
|||
|
||||
use strict;
|
||||
use warnings;
|
||||
require Lemonldap::NG::Common::CGI;
|
||||
use Lemonldap::NG::Portal::SharedConf;
|
||||
use Lemonldap::NG::Portal::_LDAP;
|
||||
use XML::LibXML;
|
||||
|
@ -49,10 +50,11 @@ sub new {
|
|||
|
||||
# Get configuration
|
||||
$self->Lemonldap::NG::Portal::Simple::getConf(@_)
|
||||
or $self->abort("Unable to get configuration");
|
||||
or Lemonldap::NG::Common::CGI->abort("Unable to read $class->new() parameters");
|
||||
|
||||
# Portal is required
|
||||
$self->abort("Portal object required") unless ( $self->{portalObject} );
|
||||
Lemonldap::NG::Common::CGI->abort("Portal object required") unless ( $self->{portalObject} );
|
||||
|
||||
|
||||
# Fill sessionInfo
|
||||
&Lemonldap::NG::Portal::Simple::getSessionInfo( $self->{portalObject} );
|
||||
|
|
|
@ -185,18 +185,18 @@ sub error_ro {
|
|||
"Parola dvs. a expirat",
|
||||
"Certificat cerut",
|
||||
'Eroare',
|
||||
'Password has been reset and now must be changed',
|
||||
'Password may not be modified',
|
||||
'Old password must also be supplied when setting a new password',
|
||||
'Insufficient password quality',
|
||||
'Password too short',
|
||||
'Password too young',
|
||||
'Password used too recently',
|
||||
' authentications remaining, change your password!',
|
||||
' seconds before password expiration, change it!',
|
||||
'Passwords mismatch',
|
||||
'Password successfully changed',
|
||||
'You have a new message',
|
||||
'Bad URL',
|
||||
'Parola a fost de resetare şi acum trebuie să fie schimbat',
|
||||
'Parola nu poate fi modificat',
|
||||
'Vechea parolă trebuie să fi, de asemenea, furnizate atunci când stabilesc o nouă parolă',
|
||||
'Calitate parola insuficiente',
|
||||
'Parola prea scurt',
|
||||
'Prea parolă nouă',
|
||||
'Parola folosit prea recent',
|
||||
' authentications rămase, schimbaţi-vă parola!',
|
||||
' secunde înainte de expirarea parola dvs., asiguraţi-vă pentru a schimba!',
|
||||
'Parolele nu se potrivesc',
|
||||
'Parola a fost schimbată',
|
||||
'Ai un mesaj nou',
|
||||
'Rea URL',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -67,7 +67,7 @@ ok( $p->{error} == PE_FORMEMPTY, 'Error code: missing password' );
|
|||
# No ldap
|
||||
$p->{extractFormInfo} = sub {
|
||||
my $self = shift;
|
||||
$self->{user} = 'user';
|
||||
$self->{user} = 'user';
|
||||
$self->{password} = '';
|
||||
PE_OK;
|
||||
};
|
||||
|
@ -79,11 +79,16 @@ $p->{setSessionInfo} = sub { PE_OK };
|
|||
$p->{unbind} = sub { PE_OK };
|
||||
$p->{store} = sub { PE_OK };
|
||||
$p->{authenticate} = sub { PE_OK };
|
||||
ok( $p->process >0 , 'User OK' );
|
||||
ok( $p->process > 0, 'User OK' );
|
||||
|
||||
# Cookie test
|
||||
$p->{id} = 1;
|
||||
ok( $p->buildCookie == PE_OK, 'Cookie build' );
|
||||
ok( ( ref( $p->{cookie} ) eq 'ARRAY' and $p->{cookie}->[0]->isa('CGI::Cookie') ), 'Valid cookie' );
|
||||
ok(
|
||||
(
|
||||
ref( $p->{cookie} ) eq 'ARRAY' and $p->{cookie}->[0]->isa('CGI::Cookie')
|
||||
),
|
||||
'Valid cookie'
|
||||
);
|
||||
ok( $p->{cookie}->[0]->value eq '1', 'Cookie value' );
|
||||
|
||||
|
|
|
@ -13,4 +13,3 @@ BEGIN { use_ok('Lemonldap::NG::Portal::SharedConf') }
|
|||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
||||
|
||||
|
|
32
modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t
Normal file
32
modules/lemonldap-ng-portal/t/50-Lemonldap-NG-Portal-Menu.t
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Before `make install' is performed this script should be runnable with
|
||||
# `make test'. After `make install' it should work as `perl Lemonldap-NG-Portal.t'
|
||||
|
||||
#########################
|
||||
|
||||
# change 'tests => 1' to 'tests => last_test_to_print';
|
||||
|
||||
use Test::More tests => 4;
|
||||
BEGIN { use_ok('Lemonldap::NG::Portal::Menu') }
|
||||
|
||||
#########################
|
||||
|
||||
# Insert your test code below, the Test::More module is use()ed here so read
|
||||
# its man page ( perldoc Test::More ) for help writing this test script.
|
||||
|
||||
my $tmp;
|
||||
|
||||
my $perl = "perl -I" . join( ' -I', @INC );
|
||||
|
||||
$tmp =
|
||||
`$perl -MLemonldap::NG::Portal::Menu -e '\$a=Lemonldap::NG::Portal::Menu->new()'`;
|
||||
ok( $tmp =~ /Portal object required/, 'Portal object required' );
|
||||
|
||||
my ( $m, $p );
|
||||
|
||||
$p = bless { cookieName => 'lemonldap', }, 'Lemonldap::NG::Portal::SharedConf';
|
||||
|
||||
ok( $m = Lemonldap::NG::Portal::Menu->new( { portalObject => $p } ),
|
||||
'constructor' );
|
||||
|
||||
ok( $m->isa('Lemonldap::NG::Portal::Menu'), 'object returned' );
|
||||
|
Loading…
Reference in New Issue
Block a user