2020-12-05 20:37:50 +01:00
|
|
|
use Test::More;
|
|
|
|
use strict;
|
|
|
|
|
|
|
|
require 't/test-lib.pm';
|
|
|
|
|
|
|
|
my $res;
|
|
|
|
my $client = LLNG::Manager::Test->new(
|
2022-02-03 21:04:10 +01:00
|
|
|
{ ini => { logLevel => 'error', useSafeJail => 1 } } );
|
2020-12-05 20:37:50 +01:00
|
|
|
|
2020-12-06 11:19:22 +01:00
|
|
|
# Test unauthenticated logout request with param
|
2020-12-05 20:37:50 +01:00
|
|
|
ok(
|
|
|
|
$res = $client->_get(
|
|
|
|
'/',
|
|
|
|
query => 'logout',
|
|
|
|
accept => 'text/html'
|
|
|
|
),
|
|
|
|
'Get logout page'
|
|
|
|
);
|
|
|
|
ok( $res->[2]->[0] =~ m%<span id="languages"></span>%, ' Language icons found' )
|
|
|
|
or print STDERR Dumper( $res->[2]->[0] );
|
2022-02-03 06:54:21 +01:00
|
|
|
ok( $res->[2]->[0] =~ m%<span trmsg="47">%, ' PE_LOGOUT_OK' )
|
2020-12-05 20:37:50 +01:00
|
|
|
or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
expectCookie($res);
|
|
|
|
count(3);
|
|
|
|
|
2020-12-06 11:19:22 +01:00
|
|
|
# Test unauthenticated logout request access with route
|
|
|
|
ok(
|
|
|
|
$res = $client->_get(
|
2022-02-16 17:43:29 +01:00
|
|
|
'/logout', accept => 'text/html'
|
2020-12-06 11:19:22 +01:00
|
|
|
),
|
|
|
|
'Get logout page'
|
|
|
|
);
|
|
|
|
ok( $res->[2]->[0] =~ m%<span id="languages"></span>%, ' Language icons found' )
|
|
|
|
or print STDERR Dumper( $res->[2]->[0] );
|
2022-02-03 06:54:21 +01:00
|
|
|
ok( $res->[2]->[0] =~ m%<span trmsg="47">%, ' PE_LOGOUT_OK' )
|
2020-12-06 11:19:22 +01:00
|
|
|
or print STDERR Dumper( $res->[2]->[0] );
|
|
|
|
expectCookie($res);
|
|
|
|
count(3);
|
|
|
|
|
2020-12-05 20:37:50 +01:00
|
|
|
#print STDERR Dumper($res);
|
|
|
|
|
|
|
|
clean_sessions();
|
|
|
|
|
|
|
|
done_testing( count() );
|