Commit 0d5144bc authored by Clément OUDOT's avatar Clément OUDOT

Correct test for CAS proxy mode activation (#242)

parent 655c6484
......@@ -65,7 +65,10 @@ sub extractFormInfo {
}
# Act as a proxy if proxied services configured
my $proxy = ref( $self->{CAS_proxiedServices} ) ? 1 : 0;
my $proxy =
ref( $self->{CAS_proxiedServices} ) eq 'HASH'
? ( %{ $self->{CAS_proxiedServices} } ? 1 : 0 )
: 0;
if ($proxy) {
$self->lmLog( "CAS: Proxy mode activated", 'debug' );
......
......@@ -5,7 +5,7 @@
# change 'tests => 1' to 'tests => last_test_to_print';
use Test::More tests => 1;
use Test::More tests => 2;
#########################
......@@ -18,23 +18,40 @@ SKIP: {
eval { require AuthCAS };
skip
"AuthCAS is not installed, so Lemonldap::NG::Portal::AuthCAS will not be useable",
1
2
if ($@);
my $p;
eval { require Lemonldap::NG::Portal::Simple };
skip
"Problem with Lemonldap::NG::Portal::Simple, Lemonldap::NG::Portal::AuthCAS will not be tested",
1
2
if ($@);
$ENV{"REQUEST_METHOD"} = 'GET';
ok(
$p = Lemonldap::NG::Portal::Simple->new(
{
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'CAS',
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'CAS',
CAS_url => 'https://cas.example.com',
CAS_pgt => '/tmp/pgt.txt',
CAS_proxiedServices => {},
}
)
),
"CAS without proxy mode"
);
ok(
$p = Lemonldap::NG::Portal::Simple->new(
{
globalStorage => 'Apache::Session::File',
domain => 'example.com',
authentication => 'CAS',
CAS_url => 'https://cas.example.com',
CAS_pgt => '/tmp/pgt.txt',
CAS_proxiedServices => { 'CAS1' => 'http://cas1.example.com' },
}
),
"CAS with proxy mode"
);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment