Skip to content

Commit ff512ea

Browse files
committed
Fix unit tests for PHP 8.3
1 parent 08750e3 commit ff512ea

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

tests/SAML2/XML/mdrpi/PublicationInfoTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ public function testMissingPublisherThrowsException(): void
125125
*/
126126
public function testMultipleUsagePoliciesWithSameLanguageThrowsException(): void
127127
{
128-
$document = clone self::$xmlRepresentation;
128+
$document = clone self::$xmlRepresentation->documentElement;
129129

130130
// Append another 'en' UsagePolicy to the document
131131
$x = new UsagePolicy('en', 'https://example.org');
132-
$x->toXML($document->documentElement);
132+
$x->toXML($document);
133133

134134
$this->expectException(ProtocolViolationException::class);
135135
$this->expectExceptionMessage(
136136
'There MUST NOT be more than one <mdrpi:UsagePolicy>,'
137137
. ' within a given <mdrpi:PublicationInfo>, for a given language'
138138
);
139-
PublicationInfo::fromXML($document->documentElement);
139+
PublicationInfo::fromXML($document);
140140
}
141141
}

tests/SAML2/XML/mdrpi/RegistrationInfoTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,17 @@ public function testRegistrationInstantTimezoneNotZuluThrowsException(): void
125125
*/
126126
public function testMultipleRegistrationPoliciesWithSameLanguageThrowsException(): void
127127
{
128-
$document = clone self::$xmlRepresentation;
128+
$document = clone self::$xmlRepresentation->documentElement;
129129

130130
// Append another 'en' RegistrationPolicy to the document
131131
$x = new RegistrationPolicy('en', 'https://example.org');
132-
$x->toXML($document->documentElement);
132+
$x->toXML($document);
133133

134134
$this->expectException(ProtocolViolationException::class);
135135
$this->expectExceptionMessage(
136136
'There MUST NOT be more than one <mdrpi:RegistrationPolicy>,'
137137
. ' within a given <mdrpi:RegistrationInfo>, for a given language'
138138
);
139-
RegistrationInfo::fromXML($document->documentElement);
139+
RegistrationInfo::fromXML($document);
140140
}
141141
}

0 commit comments

Comments
 (0)