Skip to content

Commit c47e705

Browse files
committed
Fix attribute-arrayization
1 parent 136ebfd commit c47e705

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Attribute.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ public static function fromArray(array $data): static
137137
$data['namespaceURI'],
138138
$data['namespacePrefix'],
139139
$data['attrName'],
140-
$data['attrValue'],
140+
StringValue::fromString($data['attrValue']),
141141
);
142142
}
143143

@@ -166,7 +166,7 @@ private static function processArrayContents(array $data): array
166166
Assert::nullOrValidAnyURI($data['namespaceuri']);
167167
Assert::nullOrValidNCName($data['namespaceprefix']);
168168
Assert::nullOrValidNCName($data['attrname']);
169-
Assert::isAOf($data['attrvalue'], ValueTypeInterface::class);
169+
// Assert::isAOf($data['attrvalue'], ValueTypeInterface::class);
170170

171171
return [
172172
'namespaceURI' => $data['namespaceuri'],
@@ -193,7 +193,7 @@ public function toArray(): array
193193
'namespaceURI' => $this->getNamespaceURI(),
194194
'namespacePrefix' => $this->getNamespacePrefix(),
195195
'attrName' => $this->getAttrName(),
196-
'attrValue' => $this->getAttrValue(),
196+
'attrValue' => $this->getAttrValue()->getValue(),
197197
];
198198
}
199199
}

tests/XML/AttributeTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static function setUpBeforeClass(): void
4343
'namespaceURI' => 'urn:x-simplesamlphp:phpunit',
4444
'namespacePrefix' => 'ssp',
4545
'attrName' => 'test1',
46-
'attrValue' => StringValue::fromString('testvalue1'),
46+
'attrValue' => 'testvalue1',
4747
];
4848
}
4949

@@ -68,7 +68,7 @@ public function testMarshallingArray(): void
6868

6969
/**
7070
*/
71-
public function testUnmarshalling(): void
71+
public function testUnmarshallingArray(): void
7272
{
7373
/**
7474
* @var array{
@@ -89,7 +89,7 @@ public function testUnmarshalling(): void
8989

9090
/**
9191
*/
92-
public function testMarshallingXML(): void
92+
public function testMarshalling(): void
9393
{
9494
$extendableAttribute = new Attribute(
9595
'urn:x-simplesamlphp:phpunit',

0 commit comments

Comments
 (0)