19 declare(strict_types=1);
31 $rule = $this->getMockBuilder(ilExternalAuthUserAttributeMappingRule::class)
32 ->disableOriginalConstructor()
35 ->method(
'getExternalAttribute')
36 ->willReturn($externalAttributeReference);
38 ->method(
'getAttribute')
39 ->willReturn($externalAttributeReference);
46 $expectedValue =
'ILIAS';
48 $attributeKey =
'firstname';
49 $attributeValue = $expectedValue;
51 $userData = [$attributeKey => $attributeValue];
54 $this->assertSame($expectedValue, $parser->parse());
59 $expectedValue =
'ILIAS';
61 $attributeKey =
'firstname';
62 $attributeValue = [$expectedValue];
64 $userData = [$attributeKey => $attributeValue];
67 $this->assertSame($expectedValue, $parser->parse());
72 $expectedValue =
'ILIAS';
73 $expectedValueIndex = 5;
75 $attributeKey =
'firstname';
76 $attributeValue = [$expectedValueIndex => $expectedValue];
78 $userData = [$attributeKey => $attributeValue];
84 $this->assertSame($expectedValue, $parser->parse());
89 $this->expectException(ilSamlException::class);
91 $attributeKey =
'firstname';
100 $this->expectException(ilSamlException::class);
102 $expectedValue =
'ILIAS';
103 $expectedValueIndex = 5;
105 $attributeKey =
'firstname';
106 $attributeValue = [($expectedValueIndex + 1) => $expectedValue];
108 $userData = [$attributeKey => $attributeValue];
119 $this->expectException(ilSamlException::class);
121 $expectedValue = [
'ILIAS'];
122 $expectedValueIndex = 5;
124 $attributeKey =
'firstname';
125 $attributeValue = [$expectedValueIndex => $expectedValue];
127 $userData = [$attributeKey => $attributeValue];
testExceptionIsRaisedIfAnExpectedValueCouldNotBeFoundForAnExpectedValueIndex()
testValueGivenAsArrayCanBeRetrievedForExternalAttributeWithSpecificIndex()
Class ilSamlMappedUserAttributeValueParserTest.
Class ilExternalAuthUserAttributeMappingRule.
testValueGivenAsArrayCanBeRetrievedForExternalAttribute()
testExceptionIsRaisedIfAnExpectedAttributeIsMissing()
testExceptionIsRaisedForNonScalarValues()
getMappingRuleMock(string $externalAttributeReference)
Class ilSamlMappedUserAttributeValueParser.
testValueGivenAsStringCanBeRetrievedForExternalAttribute()