14 if (version_compare(PHPUnit_Runner_Version::id(),
'5.0',
'>=')) {
15 $this->setExpectedException($exception_class);
25 $rule = $this->getMockBuilder(ilExternalAuthUserAttributeMappingRule::class)->disableOriginalConstructor()->getMock();
26 $rule->expects($this->any())->method(
'getExternalAttribute')->will($this->returnValue($externalAttributeReference));
27 $rule->expects($this->any())->method(
'getAttribute')->will($this->returnValue($externalAttributeReference));
34 $expectedValue =
'ILIAS';
36 $attributeKey =
'firstname';
37 $attributeValue = $expectedValue;
39 $userData = [$attributeKey => $attributeValue];
42 $this->assertEquals($expectedValue,
$parser->parse());
47 $expectedValue =
'ILIAS';
49 $attributeKey =
'firstname';
50 $attributeValue = [$expectedValue];
52 $userData = [$attributeKey => $attributeValue];
55 $this->assertEquals($expectedValue,
$parser->parse());
60 $expectedValue =
'ILIAS';
61 $expectedValueIndex = 5;
63 $attributeKey =
'firstname';
64 $attributeValue = [$expectedValueIndex => $expectedValue];
66 $userData = [$attributeKey => $attributeValue];
72 $this->assertEquals($expectedValue,
$parser->parse());
79 $attributeKey =
'firstname';
90 $expectedValue =
'ILIAS';
91 $expectedValueIndex = 5;
93 $attributeKey =
'firstname';
94 $attributeValue = [($expectedValueIndex + 1) => $expectedValue];
96 $userData = [$attributeKey => $attributeValue];
109 $expectedValue = array(
'ILIAS');
110 $expectedValueIndex = 5;
112 $attributeKey =
'firstname';
113 $attributeValue = [$expectedValueIndex => $expectedValue];
115 $userData = [$attributeKey => $attributeValue];
testExceptionIsRaisedIfAnExpectedValueCouldNotBeFoundForAnExpectedValueIndex()
testValueGivenAsArrayCanBeRetrievedForExternalAttributeWithSpecificIndex()
Class ilSamlMappedUserAttributeValueParserTest.
testValueGivenAsArrayCanBeRetrievedForExternalAttribute()
getMappingRuleMock($externalAttributeReference)
testExceptionIsRaisedIfAnExpectedAttributeIsMissing()
testExceptionIsRaisedForNonScalarValues()
assertException($exception_class)
Class ilSamlMappedUserAttributeValueParser.
testValueGivenAsStringCanBeRetrievedForExternalAttribute()