Skip to content

Commit

Permalink
Merge pull request #225 from MartijnVdS/wordy_bools
Browse files Browse the repository at this point in the history
Use "true" and "false" for more boolean values
  • Loading branch information
timlegge committed May 21, 2024
2 parents a19257d + 931b29f commit 9e84760
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Net/SAML2/AttributeConsumingService.pm
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ sub to_xml {
$self->namespace,
{
index => $self->index,
isDefault => $self->default,
isDefault => $self->default ? 'true' : 'false',
},
$xml->ServiceName($self->namespace, undef, $self->service_name),
$self->_has_service_description ? $xml->ServiceDescription($self->namespace, undef, $self->service_description) : (),
Expand Down
2 changes: 1 addition & 1 deletion lib/Net/SAML2/RequestedAttribute.pm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ sub _build_attributes {
my $self = shift;

my %attrs = (
$self->required ? (isRequired => 1) : (),
$self->required ? (isRequired => 'true') : (),
Name => $self->name,
$self->_has_friendly ? (FriendlyName => $self->friendly_name) : (),
);
Expand Down
6 changes: 3 additions & 3 deletions t/02-create-sp.t
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
{
Binding => BINDING_HTTP_ARTIFACT,
Location => 'https://foo.example.com/acs-http-artifact',
isDefault => 0,
isDefault => 'false',
}
],
error_url => 'https://foo.example.com/error-url',
Expand Down Expand Up @@ -469,7 +469,7 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
my $acs = get_single_node_ok($node, '//md:AttributeConsumingService');

is($acs->getAttribute('index'), 1, ".. index is 1");
is($acs->getAttribute('isDefault'), 0, "Not the default");
is($acs->getAttribute('isDefault'), 'false', "Not the default");


my @child = $acs->childNodes();
Expand All @@ -486,7 +486,7 @@ use URN::OASIS::SAML2 qw(:bindings :urn);
is($child[1]->getAttribute('FriendlyName'),
'foo', ".. with the correct friendly name");
is($child[1]->getAttribute('Name'), 'urn:foo:bar', ".. and name");
is($child[1]->getAttribute('isRequired'), '1', ".. and requiredness");
is($child[1]->getAttribute('isRequired'), 'true', ".. and requiredness");
}

{
Expand Down

0 comments on commit 9e84760

Please sign in to comment.