@@ -2,7 +2,7 @@ use strict;
22use warnings;
33use Test::Lib;
44use Test::Net::SAML2;
5- use URN::OASIS::SAML2 qw( :urn) ;
5+ use URN::OASIS::SAML2 qw( :urn NAMEID_EMAIL ) ;
66
77use Net::SAML2::Protocol::LogoutRequest;
88
@@ -39,12 +39,34 @@ test_xml_attribute_ok($xpath, '/samlp:LogoutRequest/@IssueInstant', 'foo');
3939my $name_id = get_single_node_ok($xpath , ' /samlp:LogoutRequest/saml:NameID' );
4040is($name_id -> getAttribute(' Format' ), $args {nameid_format });
4141
42- foreach (qw( NameQualifier SPNameQualifier SPProvidedID) ) {
43- is(
44- $name_id -> getAttribute($_ ),
45- undef ,
46- " We don't have $_ as an attribute in the nameid"
42+ foreach (qw( NameQualifier SPNameQualifier) ) {
43+ isnt($name_id -> getAttribute($_ ),
44+ undef , " We don't have $_ as an attribute in the nameid" );
45+ }
46+
47+ is(
48+ $name_id -> getAttribute(' SPProvidedID' ),
49+ undef ,
50+ " We don't have SPProvidedID as an attribute in the nameid"
51+ );
52+
53+ {
54+ my $lor = Net::SAML2::Protocol::LogoutRequest-> new(%args , nameid_format => NAMEID_EMAIL());
55+ my $xpath = get_xpath(
56+ $lor -> as_xml,
57+ samlp => URN_PROTOCOL,
58+ saml => URN_ASSERTION,
4759 );
60+ test_xml_attribute_ok($xpath , ' /samlp:LogoutRequest/@ID' , qr / ^NETSAML2_/ );
61+ test_xml_attribute_ok($xpath , ' /samlp:LogoutRequest/@IssueInstant' , ' foo' );
62+ my $name_id = get_single_node_ok($xpath , ' /samlp:LogoutRequest/saml:NameID' );
63+ is($name_id -> getAttribute(' Format' ), NAMEID_EMAIL());
64+
65+ foreach (qw( NameQualifier SPNameQualifier SPProvidedID) ) {
66+ is($name_id -> getAttribute($_ ),
67+ undef , " We don't have $_ as an attribute in the nameid" );
68+ }
69+
4870}
4971
5072{
0 commit comments