2017-01-16 22:07:12 +01:00
|
|
|
use Test::More;
|
|
|
|
use strict;
|
|
|
|
use IO::String;
|
|
|
|
|
|
|
|
BEGIN {
|
|
|
|
require 't/test-lib.pm';
|
|
|
|
}
|
|
|
|
|
|
|
|
my $res;
|
|
|
|
|
2019-02-07 09:27:56 +01:00
|
|
|
my $client = LLNG::Manager::Test->new( {
|
2017-01-16 22:07:12 +01:00
|
|
|
ini => {
|
|
|
|
logLevel => 'error',
|
|
|
|
portalStatus => 1,
|
|
|
|
authentication => 'Demo',
|
2017-02-05 10:13:20 +01:00
|
|
|
userDB => 'Same',
|
2017-01-16 22:07:12 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
);
|
|
|
|
|
|
|
|
ok(
|
|
|
|
$res = $client->_post(
|
|
|
|
'/',
|
|
|
|
IO::String->new('user=dwho&password=dwho'),
|
|
|
|
length => 23
|
|
|
|
),
|
|
|
|
'Auth query'
|
|
|
|
);
|
|
|
|
count(1);
|
|
|
|
expectOK($res);
|
|
|
|
my $id = expectCookie($res);
|
|
|
|
|
|
|
|
ok( $res = $client->_get('/portalStatus'), 'Get status' );
|
|
|
|
count(1);
|
|
|
|
expectOK($res);
|
|
|
|
eval { $res = JSON::from_json( $res->[2]->[0] ) };
|
|
|
|
|
|
|
|
ok( !$@, 'Content is JSON' ) or print STDERR Dumper($@);
|
|
|
|
count(1);
|
|
|
|
|
2017-02-18 20:20:58 +01:00
|
|
|
ok( $res->{storage}->{global} == 1, 'Found 1 session' );
|
|
|
|
ok( $res->{storage}->{persistent} == 1, 'Found 1 persistent session' );
|
2017-01-16 22:07:12 +01:00
|
|
|
count(2);
|
|
|
|
|
|
|
|
clean_sessions();
|
|
|
|
|
|
|
|
done_testing( count() );
|