Skip to content

Commit

Permalink
Rename use_as_nameid arp property
Browse files Browse the repository at this point in the history
Occurences of `use_as_name_id` changed to `use_as_nameid`
  • Loading branch information
MKodde committed Jul 17, 2024
1 parent 7075694 commit c4c973a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function build(ManageEntity $entity): array
'value' => $attribute->getValue() === '' ? '*' : $attribute->getValue(),
'motivation' => $attribute->getMotivation(),
'release_as' => $attribute->getReleaseAs() ?? '',
'use_as_name_id' => $attribute->getUseAsNameId() ?? false,
'use_as_nameid' => $attribute->getUseAsNameId() ?? false,
];
}
}
Expand Down Expand Up @@ -88,7 +88,7 @@ private function addManageOnlyAttributes(array &$attributes, ManageEntity $entit
'value' => $attribute->getValue(),
'motivation' => $attribute->getMotivation(),
'release_as' => $attribute->getReleaseAs(),
'use_as_name_id' => $attribute->getUseAsNameId(),
'use_as_nameid' => $attribute->getUseAsNameId(),
];
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ public static function fromApiResponse($attributeName, array $attributeData): At
$source = $attributeData['source'] ?? '';
$motivation = $attributeData['motivation'] ?? '';
$releaseAs = $attributeData['release_as'] ?? '';
$useAsNameId = $attributeData['use_as_name_id'] ?? false;
$useAsNameId = $attributeData['use_as_nameid'] ?? false;

Assert::stringNotEmpty($attributeName, 'The attribute name must be non-empty string');
Assert::stringNotEmpty($value, 'The attribute value must be non-empty string');
Assert::string($source, 'The attribute source must be string');
Assert::string($releaseAs, 'The attribute release_as must be string');
Assert::boolean($useAsNameId, 'The attribute use_as_name_id must be boolean');
Assert::boolean($useAsNameId, 'The attribute use_as_nameid must be boolean');
Assert::string($motivation, 'The attribute motivation must be string');

return new self(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,25 +91,25 @@ public function test_does_not_override_existing_manage_attributes_and_source_and
$this->assertEquals('idp', $metadata['attributes']['urn:mace:dir:attribute-def:displayName'][0]['source']);
$this->assertEquals('*', $metadata['attributes']['urn:mace:dir:attribute-def:displayName'][0]['value']);
$this->assertEquals('456', $metadata['attributes']['urn:mace:dir:attribute-def:displayName'][0]['release_as']);
$this->assertTrue($metadata['attributes']['urn:mace:dir:attribute-def:displayName'][0]['use_as_name_id']);
$this->assertTrue($metadata['attributes']['urn:mace:dir:attribute-def:displayName'][0]['use_as_nameid']);

$this->assertNotEmpty($metadata['attributes']['urn:mace:dir:attribute-def:cn']);
$this->assertEquals('voot', $metadata['attributes']['urn:mace:dir:attribute-def:cn'][0]['source']);
$this->assertEquals('*', $metadata['attributes']['urn:mace:dir:attribute-def:cn'][0]['value']);
$this->assertEquals('123', $metadata['attributes']['urn:mace:dir:attribute-def:cn'][0]['release_as']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:cn'][0]['use_as_name_id']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:cn'][0]['use_as_nameid']);

$this->assertNotEmpty($metadata['attributes']['urn:mace:dir:attribute-def:givenName']);
$this->assertEquals('idp', $metadata['attributes']['urn:mace:dir:attribute-def:givenName'][0]['source']);
$this->assertEquals('*', $metadata['attributes']['urn:mace:dir:attribute-def:givenName'][0]['value']);
$this->assertEquals('789', $metadata['attributes']['urn:mace:dir:attribute-def:givenName'][0]['release_as']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:givenName'][0]['use_as_name_id']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:givenName'][0]['use_as_nameid']);

$this->assertNotEmpty($metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement']);
$this->assertEquals('sab', $metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement'][0]['source']);
$this->assertEquals('/^foobar(.*)$/i', $metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement'][0]['value']);
$this->assertEquals('123', $metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement'][0]['release_as']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement'][0]['use_as_name_id']);
$this->assertFalse($metadata['attributes']['urn:mace:dir:attribute-def:eduPersonEntitlement'][0]['use_as_nameid']);

}

Expand Down

0 comments on commit c4c973a

Please sign in to comment.