19 declare(strict_types=1);
27 $rule = $this->getMockBuilder(ilExternalAuthUserAttributeMappingRule::class)
28 ->disableOriginalConstructor()
31 ->method(
'getExternalAttribute')
32 ->willReturn($externalAttributeReference);
34 ->method(
'getAttribute')
35 ->willReturn($externalAttributeReference);
42 $expectedValue =
'ILIAS';
44 $attributeKey =
'firstname';
45 $attributeValue = $expectedValue;
47 $userData = [$attributeKey => $attributeValue];
50 $this->assertSame($expectedValue, $parser->parse());
55 $expectedValue =
'ILIAS';
57 $attributeKey =
'firstname';
58 $attributeValue = [$expectedValue];
60 $userData = [$attributeKey => $attributeValue];
63 $this->assertSame($expectedValue, $parser->parse());
68 $expectedValue =
'ILIAS';
69 $expectedValueIndex = 5;
71 $attributeKey =
'firstname';
72 $attributeValue = [$expectedValueIndex => $expectedValue];
74 $userData = [$attributeKey => $attributeValue];
80 $this->assertSame($expectedValue, $parser->parse());
85 $this->expectException(ilSamlException::class);
87 $attributeKey =
'firstname';
96 $this->expectException(ilSamlException::class);
98 $expectedValue =
'ILIAS';
99 $expectedValueIndex = 5;
101 $attributeKey =
'firstname';
102 $attributeValue = [($expectedValueIndex + 1) => $expectedValue];
104 $userData = [$attributeKey => $attributeValue];
115 $this->expectException(ilSamlException::class);
117 $expectedValue = [
'ILIAS'];
118 $expectedValueIndex = 5;
120 $attributeKey =
'firstname';
121 $attributeValue = [$expectedValueIndex => $expectedValue];
123 $userData = [$attributeKey => $attributeValue];
testExceptionIsRaisedIfAnExpectedValueCouldNotBeFoundForAnExpectedValueIndex()
testValueGivenAsArrayCanBeRetrievedForExternalAttributeWithSpecificIndex()
Class ilExternalAuthUserAttributeMappingRule.
testValueGivenAsArrayCanBeRetrievedForExternalAttribute()
testExceptionIsRaisedIfAnExpectedAttributeIsMissing()
testExceptionIsRaisedForNonScalarValues()
getMappingRuleMock(string $externalAttributeReference)
testValueGivenAsStringCanBeRetrievedForExternalAttribute()