17 $rule = $this->getMockBuilder(ilExternalAuthUserAttributeMappingRule::class)->disableOriginalConstructor()->getMock();
18 $rule->expects($this->any())->method(
'getExternalAttribute')->will($this->returnValue($externalAttributeReference));
19 $rule->expects($this->any())->method(
'getAttribute')->will($this->returnValue($externalAttributeReference));
26 $expectedValue =
'ILIAS';
28 $attributeKey =
'firstname';
29 $attributeValue = $expectedValue;
31 $userData = [$attributeKey => $attributeValue];
34 $this->assertEquals($expectedValue, $parser->parse());
39 $expectedValue =
'ILIAS';
41 $attributeKey =
'firstname';
42 $attributeValue = [$expectedValue];
44 $userData = [$attributeKey => $attributeValue];
47 $this->assertEquals($expectedValue, $parser->parse());
52 $expectedValue =
'ILIAS';
53 $expectedValueIndex = 5;
55 $attributeKey =
'firstname';
56 $attributeValue = [$expectedValueIndex => $expectedValue];
58 $userData = [$attributeKey => $attributeValue];
64 $this->assertEquals($expectedValue, $parser->parse());
69 $this->expectException(ilSamlException::class);
71 $attributeKey =
'firstname';
80 $this->expectException(ilSamlException::class);
82 $expectedValue =
'ILIAS';
83 $expectedValueIndex = 5;
85 $attributeKey =
'firstname';
86 $attributeValue = [($expectedValueIndex + 1) => $expectedValue];
88 $userData = [$attributeKey => $attributeValue];
99 $this->expectException(ilSamlException::class);
101 $expectedValue = array(
'ILIAS');
102 $expectedValueIndex = 5;
104 $attributeKey =
'firstname';
105 $attributeValue = [$expectedValueIndex => $expectedValue];
107 $userData = [$attributeKey => $attributeValue];
testExceptionIsRaisedIfAnExpectedValueCouldNotBeFoundForAnExpectedValueIndex()
testValueGivenAsArrayCanBeRetrievedForExternalAttributeWithSpecificIndex()
Class ilSamlMappedUserAttributeValueParserTest.
testValueGivenAsArrayCanBeRetrievedForExternalAttribute()
getMappingRuleMock($externalAttributeReference)
testExceptionIsRaisedIfAnExpectedAttributeIsMissing()
testExceptionIsRaisedForNonScalarValues()
Class ilSamlMappedUserAttributeValueParser.
testValueGivenAsStringCanBeRetrievedForExternalAttribute()