Skip to content
Snippets Groups Projects
Commit cdffeeac authored by Guillaume ROUSSE's avatar Guillaume ROUSSE
Browse files

extraction tests

parent 17445d4f
Branches
Tags
No related merge requests found
t/edugain.xml 0 → 100644
+ 429169
0
View file @ cdffeeac
This diff is collapsed.
......@@ -10,7 +10,7 @@ use Test::Exception;
use IdPAccountManager::SAMLMetadata;
plan tests => 6;
plan tests => 16;
my $metadata;
......@@ -74,3 +74,24 @@ throws_ok {
);
} qr/^incorrect root element type 'root'/,
'instanciation: incorrect xml file';
lives_ok {
$metadata = IdPAccountManager::SAMLMetadata->new(
file => 't/edugain.xml'
);
} 'instanciation: edugain metadata';
my $all = $metadata->parse();
ok(defined $all, 'metadata extraction: defined result');
ok(ref $all eq 'ARRAY', 'metadata extraction: result type');
ok(scalar @$all == 4318, 'metadata extraction: result count');
my $sp = $metadata->parse(entity_id => 'https://filesender.ipm.ir/');
ok(defined $sp, 'filtered metadata extraction: defined result');
ok(ref $sp eq 'ARRAY', 'filtered metadata extraction: result type');
ok(scalar @$sp == 1, 'filtered metadata extraction: result count');
my $none = $metadata->parse(entity_id => 'https://no.such.sp/');
ok(defined $none, 'filtered metadata extraction: defined result');
ok(ref $none eq 'ARRAY', 'filtered metadata extraction: result type');
ok(scalar @$none == 0, 'filtered metadata extraction: result count');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment