Unit test for #2609
This commit is contained in:
parent
44cb0444fe
commit
58964e73bc
|
@ -16,6 +16,7 @@ my $client = LLNG::Manager::Test->new( {
|
|||
loginHistoryEnabled => 1,
|
||||
brutForceProtection => 0,
|
||||
portalMainLogo => 'common/logos/logo_llng_old.png',
|
||||
customPlugins => "t::HistoryPlugin",
|
||||
sessionDataToRemember =>
|
||||
{ uid => 'identity', _auth => 'AuthModule' },
|
||||
}
|
||||
|
@ -122,16 +123,20 @@ ok( $res->[2]->[0] =~ /trspan="lastFailedLoginsCaptionLabel"/,
|
|||
'Failed history array caption found' )
|
||||
or explain( $res->[2]->[0] );
|
||||
count(2);
|
||||
|
||||
like( $res->[2]->[0], qr,<th>Language</th>,, "Found plugin-set label" );
|
||||
count(1);
|
||||
|
||||
@c = ( $res->[2]->[0] =~ /<td>127.0.0.1/gs );
|
||||
my @cf = ( $res->[2]->[0] =~ /PE5<\/td>/gs );
|
||||
my @ccv1 = ( $res->[2]->[0] =~ /<td>dwho<\/td>/gs );
|
||||
my @ccv2 = ( $res->[2]->[0] =~ /<td>Demo<\/td>/gs );
|
||||
my @ccv3 = ( $res->[2]->[0] =~ /<td>en<\/td>/gs );
|
||||
|
||||
# History with 5 entries and 10 custom values
|
||||
ok( @c == 5, ' -> Five entries found' );
|
||||
ok( @cf == 2, " -> Two 'failedLogin' entries found" );
|
||||
ok( @ccv1 + @ccv2 == 10, " -> Ten custom value entries found" )
|
||||
or print STDERR Dumper( $res->[2]->[0] );
|
||||
ok( @c == 5, ' -> Five entries found' );
|
||||
ok( @cf == 2, " -> Two 'failedLogin' entries found" );
|
||||
is( @ccv1 + @ccv2 + @ccv3, 15, "Custom value entries found" );
|
||||
count(4);
|
||||
|
||||
$client->logout($id1);
|
||||
|
|
13
lemonldap-ng-portal/t/HistoryPlugin.pm
Normal file
13
lemonldap-ng-portal/t/HistoryPlugin.pm
Normal file
|
@ -0,0 +1,13 @@
|
|||
package t::HistoryPlugin;
|
||||
|
||||
use Mouse;
|
||||
extends 'Lemonldap::NG::Portal::Main::Plugin';
|
||||
|
||||
sub init {
|
||||
my ($self) = @_;
|
||||
$self->addSessionDataToRemember( { "_language" => "Language" } );
|
||||
return 1;
|
||||
}
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user