From e408359be1bbb1167d9d98de779d5491495f494a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 5 Jun 2026 21:00:14 +0200 Subject: [PATCH 1/3] Bump minimum PHP-version to 8.5 --- .github/workflows/php.yml | 8 ++++---- composer.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 97c8c1f..22b9b40 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: ['8.3', '8.4', '8.5'] + php-version: ['8.5'] uses: simplesamlphp/simplesamlphp-test-framework/.github/workflows/reusable_phplinter.yml@v1 secrets: inherit @@ -47,7 +47,7 @@ jobs: fail-fast: false matrix: operating-system: [ubuntu-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5'] steps: - name: Setup PHP, with composer and extensions @@ -109,7 +109,7 @@ jobs: fail-fast: true matrix: operating-system: [windows-latest] - php-versions: ['8.3', '8.4', '8.5'] + php-versions: ['8.5'] steps: - name: Setup PHP, with composer and extensions @@ -162,7 +162,7 @@ jobs: uses: shivammathur/setup-php@v2 with: # Should be the lowest supported version - php-version: '8.3' + php-version: '8.5' extensions: ctype, date, dom, intl, pcre, sodium, spl, xml tools: composer coverage: none diff --git a/composer.json b/composer.json index a4a7cbe..4263c03 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ } ], "require": { - "php": "^8.3", + "php": "^8.5", "ext-dom": "*", "simplesamlphp/assert": "~2.0", From 96770aaf3df195ebd6564ffc5a0fa5964a6ea952 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Fri, 5 Jun 2026 21:44:37 +0200 Subject: [PATCH 2/3] Migrate DOM-classes to PHP 8.4's new DOM-API --- composer.json | 8 ++++---- src/Utils/XPath.php | 11 +++++------ src/XML/wsa_200408/AbstractAttributedQNameType.php | 10 +++++----- src/XML/wsa_200408/AbstractAttributedURIType.php | 10 +++++----- src/XML/wsa_200408/AbstractEndpointReferenceType.php | 10 +++++----- src/XML/wsa_200408/AbstractRelationshipType.php | 10 +++++----- src/XML/wsa_200408/AbstractRetryAfterType.php | 10 +++++----- src/XML/wsa_200408/AbstractServiceNameType.php | 10 +++++----- src/XML/wsa_200408/ReferenceParameters.php | 10 +++++----- src/XML/wsa_200408/ReferenceProperties.php | 10 +++++----- src/XML/wsa_200508/AbstractAttributedQNameType.php | 10 +++++----- src/XML/wsa_200508/AbstractAttributedURIType.php | 10 +++++----- .../wsa_200508/AbstractAttributedUnsignedLongType.php | 10 +++++----- src/XML/wsa_200508/AbstractEndpointReferenceType.php | 10 +++++----- src/XML/wsa_200508/AbstractProblemActionType.php | 6 +++--- src/XML/wsa_200508/Metadata.php | 10 +++++----- src/XML/wsa_200508/ProblemAction.php | 6 +++--- src/XML/wsa_200508/ReferenceParameters.php | 10 +++++----- src/XML/wsa_200508/RelatesTo.php | 10 +++++----- src/XML/wsam/AbstractAddressing.php | 6 +++--- src/XML/wsam/AbstractAnonymousResponses.php | 6 +++--- src/XML/wsam/AbstractAttributedQNameType.php | 6 +++--- src/XML/wsam/AbstractNonAnonymousResponses.php | 6 +++--- src/XML/wsam/AbstractServiceNameType.php | 6 +++--- src/XML/wsam/Addressing.php | 6 +++--- src/XML/wsam/AnonymousResponses.php | 6 +++--- src/XML/wsam/InterfaceName.php | 6 +++--- src/XML/wsam/NonAnonymousResponses.php | 6 +++--- src/XML/wsam/ServiceName.php | 6 +++--- src/XML/wsam/UsingAddressing.php | 10 +++++----- src/XML/wsaw/AbstractAnonymousType.php | 6 +++--- src/XML/wsaw/AbstractAttributedQNameType.php | 6 +++--- src/XML/wsaw/AbstractServiceNameType.php | 6 +++--- src/XML/wsaw/Anonymous.php | 10 +++++----- src/XML/wsaw/InterfaceName.php | 6 +++--- src/XML/wsaw/ServiceName.php | 6 +++--- src/XML/wsaw/UsingAddressing.php | 10 +++++----- 37 files changed, 150 insertions(+), 151 deletions(-) diff --git a/composer.json b/composer.json index de2e14d..e413edc 100644 --- a/composer.json +++ b/composer.json @@ -14,13 +14,13 @@ "ext-dom": "*", "simplesamlphp/assert": "~2.0", - "simplesamlphp/xml-common": "~2.8", - "simplesamlphp/xml-ws-policy": "~1.3", - "simplesamlphp/xml-wss-core": "~1.4" + "simplesamlphp/xml-common": "dev-feature/dom-migration-php84", + "simplesamlphp/xml-ws-policy": "dev-feature/dom-migration-php84", + "simplesamlphp/xml-wss-core": "dev-feature/dom-migration-php84" }, "require-dev": { "simplesamlphp/simplesamlphp-test-framework": "~1.11", - "simplesamlphp/xml-soap": "~2.3" + "simplesamlphp/xml-soap": "dev-feature/dom-migration-php84" }, "autoload": { "psr-4": { diff --git a/src/Utils/XPath.php b/src/Utils/XPath.php index 73698a4..ed96b0b 100644 --- a/src/Utils/XPath.php +++ b/src/Utils/XPath.php @@ -4,8 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\Utils; -use DOMNode; -use DOMXPath; +use Dom; use SimpleSAML\WebServices\Addressing\Constants as C; /** @@ -16,15 +15,15 @@ class XPath extends \SimpleSAML\XPath\XPath { /* - * Get a DOMXPath object that can be used to search for WS-Addressing elements. + * Get a Dom\XPath object that can be used to search for WS-Addressing elements. * - * @param \DOMNode $node The document to associate to the DOMXPath object. + * @param \Dom\Node $node The document to associate to the Dom\XPath object. * @param bool $autoregister Whether to auto-register all namespaces used in the document * - * @return \DOMXPath A DOMXPath object ready to use in the given document, with several + * @return \Dom\XPath A Dom\XPath object ready to use in the given document, with several * ws-related namespaces already registered. */ - public static function getXPath(DOMNode $node, bool $autoregister = false): DOMXPath + public static function getXPath(Dom\Node $node, bool $autoregister = false): Dom\XPath { $xp = parent::getXPath($node, $autoregister); diff --git a/src/XML/wsa_200408/AbstractAttributedQNameType.php b/src/XML/wsa_200408/AbstractAttributedQNameType.php index 8fb5e94..20229f3 100644 --- a/src/XML/wsa_200408/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200408/AbstractAttributedQNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -49,12 +49,12 @@ final public function __construct(QNameValue $value, array $namespacedAttributes /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\lement|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200408/AbstractAttributedURIType.php b/src/XML/wsa_200408/AbstractAttributedURIType.php index fff4b55..6f6924c 100644 --- a/src/XML/wsa_200408/AbstractAttributedURIType.php +++ b/src/XML/wsa_200408/AbstractAttributedURIType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -49,12 +49,12 @@ final public function __construct(AnyURIValue $value, array $namespacedAttribute /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200408/AbstractEndpointReferenceType.php b/src/XML/wsa_200408/AbstractEndpointReferenceType.php index 676a672..2caa945 100644 --- a/src/XML/wsa_200408/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200408/AbstractEndpointReferenceType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; @@ -125,14 +125,14 @@ public function getServiceName(): ?ServiceName * * Note: this method cannot be used when extending this class, if the constructor has a different signature. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException * if the supplied element is missing any of the mandatory attributes */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { $qualifiedName = static::getClassName(static::class); Assert::eq( @@ -173,9 +173,9 @@ public static function fromXML(DOMElement $xml): static /** * Add this endpoint reference to an XML element. * - * @param \DOMElement|null $parent The element we should append this endpoint to. + * @param \Dom\Element|null $parent The element we should append this endpoint to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::instantiateParentElement($parent); diff --git a/src/XML/wsa_200408/AbstractRelationshipType.php b/src/XML/wsa_200408/AbstractRelationshipType.php index 26e5c22..8490413 100644 --- a/src/XML/wsa_200408/AbstractRelationshipType.php +++ b/src/XML/wsa_200408/AbstractRelationshipType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -63,12 +63,12 @@ public function getRelationshipType(): ?QNameValue /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -84,9 +84,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200408/AbstractRetryAfterType.php b/src/XML/wsa_200408/AbstractRetryAfterType.php index 3e4c710..470d177 100644 --- a/src/XML/wsa_200408/AbstractRetryAfterType.php +++ b/src/XML/wsa_200408/AbstractRetryAfterType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -51,12 +51,12 @@ final public function __construct( /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -68,9 +68,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200408/AbstractServiceNameType.php b/src/XML/wsa_200408/AbstractServiceNameType.php index 3b33273..bb3975f 100644 --- a/src/XML/wsa_200408/AbstractServiceNameType.php +++ b/src/XML/wsa_200408/AbstractServiceNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -63,12 +63,12 @@ public function getPortName(): ?NCNameValue /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -84,9 +84,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200408/ReferenceParameters.php b/src/XML/wsa_200408/ReferenceParameters.php index 6877e1f..06fba1e 100644 --- a/src/XML/wsa_200408/ReferenceParameters.php +++ b/src/XML/wsa_200408/ReferenceParameters.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -47,12 +47,12 @@ public function isEmptyElement(): bool /* * Convert XML into an ReferenceParameters element * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this ReferenceParameters to XML. * - * @param \DOMElement|null $parent The element we should add this ReferenceParameters to. + * @param \Dom\Element|null $parent The element we should add this ReferenceParameters to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsa_200408/ReferenceProperties.php b/src/XML/wsa_200408/ReferenceProperties.php index 623f22a..7ace11a 100644 --- a/src/XML/wsa_200408/ReferenceProperties.php +++ b/src/XML/wsa_200408/ReferenceProperties.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableElementTrait; use SimpleSAML\XMLSchema\Exception\InvalidDOMElementException; @@ -47,12 +47,12 @@ public function isEmptyElement(): bool /* * Convert XML into an ReferenceProperties element * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this ReferenceProperties to XML. * - * @param \DOMElement|null $parent The element we should add this ReferenceProperties to. + * @param \Dom\Element|null $parent The element we should add this ReferenceProperties to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsa_200508/AbstractAttributedQNameType.php b/src/XML/wsa_200508/AbstractAttributedQNameType.php index 05c0685..b57f032 100644 --- a/src/XML/wsa_200508/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200508/AbstractAttributedQNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -49,12 +49,12 @@ final public function __construct(QNameValue $value, array $namespacedAttributes /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200508/AbstractAttributedURIType.php b/src/XML/wsa_200508/AbstractAttributedURIType.php index 16d291d..a05be0b 100644 --- a/src/XML/wsa_200508/AbstractAttributedURIType.php +++ b/src/XML/wsa_200508/AbstractAttributedURIType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -49,12 +49,12 @@ final public function __construct(AnyURIValue $value, array $namespacedAttribute /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php index 5357b4a..5d97ed0 100644 --- a/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php +++ b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; @@ -49,12 +49,12 @@ final public function __construct(UnsignedLongValue $value, array $namespacedAtt /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -66,9 +66,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsa_200508/AbstractEndpointReferenceType.php b/src/XML/wsa_200508/AbstractEndpointReferenceType.php index fcb2cbd..477f51a 100644 --- a/src/XML/wsa_200508/AbstractEndpointReferenceType.php +++ b/src/XML/wsa_200508/AbstractEndpointReferenceType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; @@ -99,14 +99,14 @@ public function getMetadata(): ?Metadata * * Note: this method cannot be used when extending this class, if the constructor has a different signature. * - * @param \DOMElement $xml The XML element we should load. + * @param \Dom\Element $xml The XML element we should load. * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong * @throws \SimpleSAML\XMLSchema\Exception\MissingAttributeException * if the supplied element is missing any of the mandatory attributes */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { $qualifiedName = static::getClassName(static::class); Assert::eq( @@ -139,9 +139,9 @@ public static function fromXML(DOMElement $xml): static /** * Add this endpoint reference to an XML element. * - * @param \DOMElement $parent The element we should append this endpoint to. + * @param \Dom\Element $parent The element we should append this endpoint to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::instantiateParentElement($parent); diff --git a/src/XML/wsa_200508/AbstractProblemActionType.php b/src/XML/wsa_200508/AbstractProblemActionType.php index 5fcbb79..b559f45 100644 --- a/src/XML/wsa_200508/AbstractProblemActionType.php +++ b/src/XML/wsa_200508/AbstractProblemActionType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -54,9 +54,9 @@ public function isEmptyElement(): bool /** * Convert this element to XML. * - * @param \DOMElement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsa_200508/Metadata.php b/src/XML/wsa_200508/Metadata.php index f3ecc99..b3c7fd1 100644 --- a/src/XML/wsa_200508/Metadata.php +++ b/src/XML/wsa_200508/Metadata.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; @@ -57,12 +57,12 @@ public function isEmptyElement(): bool /* * Convert XML into an Metadata element * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -77,9 +77,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this Metadata to XML. * - * @param \DOMElement|null $parent The element we should add this Metadata to. + * @param \Dom\Element|null $parent The element we should add this Metadata to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsa_200508/ProblemAction.php b/src/XML/wsa_200508/ProblemAction.php index 6348e3f..86cd381 100644 --- a/src/XML/wsa_200508/ProblemAction.php +++ b/src/XML/wsa_200508/ProblemAction.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -26,12 +26,12 @@ final class ProblemAction extends AbstractProblemActionType implements SchemaVal /** * Convert XML into a class instance * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsa_200508/ReferenceParameters.php b/src/XML/wsa_200508/ReferenceParameters.php index 28feff3..88e9cc2 100644 --- a/src/XML/wsa_200508/ReferenceParameters.php +++ b/src/XML/wsa_200508/ReferenceParameters.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\ExtendableElementTrait; @@ -57,12 +57,12 @@ public function isEmptyElement(): bool /* * Convert XML into an ReferenceParameters element * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -77,9 +77,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this ReferenceParameters to XML. * - * @param \DOMElement|null $parent The element we should add this ReferenceParameters to. + * @param \Dom\Element|null $parent The element we should add this ReferenceParameters to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsa_200508/RelatesTo.php b/src/XML/wsa_200508/RelatesTo.php index a4a6e00..1fe0a8c 100644 --- a/src/XML/wsa_200508/RelatesTo.php +++ b/src/XML/wsa_200508/RelatesTo.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; @@ -63,12 +63,12 @@ public function getRelationshipType(): ?AnyURIValue /* * Convert XML into an RelatesTo element * - * @param \DOMElement $xml The XML element we should load + * @param \Dom\Element $xml The XML element we should load * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * If the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -84,9 +84,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this RelatesTo to XML. * - * @param \DOMElement|null $parent The element we should add this RelatesTo to. + * @param \Dom\Element|null $parent The element we should add this RelatesTo to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsam/AbstractAddressing.php b/src/XML/wsam/AbstractAddressing.php index 4833b03..84b2419 100644 --- a/src/XML/wsam/AbstractAddressing.php +++ b/src/XML/wsam/AbstractAddressing.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Policy\XML\wsp_200607\Policy; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -60,9 +60,9 @@ public function getPolicy(): Policy /** * Convert this Addressing to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsam/AbstractAnonymousResponses.php b/src/XML/wsam/AbstractAnonymousResponses.php index 5817648..4810381 100644 --- a/src/XML/wsam/AbstractAnonymousResponses.php +++ b/src/XML/wsam/AbstractAnonymousResponses.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -46,9 +46,9 @@ public function isEmptyElement(): bool /** * Convert this AnonymousResponses to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsam/AbstractAttributedQNameType.php b/src/XML/wsam/AbstractAttributedQNameType.php index 944244e..e024f94 100644 --- a/src/XML/wsam/AbstractAttributedQNameType.php +++ b/src/XML/wsam/AbstractAttributedQNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -45,9 +45,9 @@ public function __construct( /** * Convert this AttributedQNameType to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsam/AbstractNonAnonymousResponses.php b/src/XML/wsam/AbstractNonAnonymousResponses.php index 75bf770..a4ad949 100644 --- a/src/XML/wsam/AbstractNonAnonymousResponses.php +++ b/src/XML/wsam/AbstractNonAnonymousResponses.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XMLSchema\XML\Constants\NS; @@ -46,9 +46,9 @@ public function isEmptyElement(): bool /** * Convert this NonAnonymousResponses to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsam/AbstractServiceNameType.php b/src/XML/wsam/AbstractServiceNameType.php index 4d4f737..b9009d8 100644 --- a/src/XML/wsam/AbstractServiceNameType.php +++ b/src/XML/wsam/AbstractServiceNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -59,9 +59,9 @@ public function getEndpointName(): ?NCNameValue /** * Convert this ServiceNameType to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsam/Addressing.php b/src/XML/wsam/Addressing.php index 2ee6293..01495a3 100644 --- a/src/XML/wsam/Addressing.php +++ b/src/XML/wsam/Addressing.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\WebServices\Policy\XML\wsp_200607\Policy; use SimpleSAML\XML\SchemaValidatableElementInterface; @@ -26,12 +26,12 @@ final class Addressing extends AbstractAddressing implements SchemaValidatableEl /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsam/AnonymousResponses.php b/src/XML/wsam/AnonymousResponses.php index 3fbf24e..b329b0f 100644 --- a/src/XML/wsam/AnonymousResponses.php +++ b/src/XML/wsam/AnonymousResponses.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -23,12 +23,12 @@ final class AnonymousResponses extends AbstractAnonymousResponses implements Sch /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsam/InterfaceName.php b/src/XML/wsam/InterfaceName.php index 9787d49..a81d218 100644 --- a/src/XML/wsam/InterfaceName.php +++ b/src/XML/wsam/InterfaceName.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -24,12 +24,12 @@ final class InterfaceName extends AbstractAttributedQNameType implements SchemaV /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsam/NonAnonymousResponses.php b/src/XML/wsam/NonAnonymousResponses.php index 3a8fabc..3a5a085 100644 --- a/src/XML/wsam/NonAnonymousResponses.php +++ b/src/XML/wsam/NonAnonymousResponses.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -23,12 +23,12 @@ final class NonAnonymousResponses extends AbstractNonAnonymousResponses implemen /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsam/ServiceName.php b/src/XML/wsam/ServiceName.php index 22d85e8..3a2c717 100644 --- a/src/XML/wsam/ServiceName.php +++ b/src/XML/wsam/ServiceName.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -25,12 +25,12 @@ final class ServiceName extends AbstractServiceNameType implements SchemaValidat /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsam/UsingAddressing.php b/src/XML/wsam/UsingAddressing.php index aa3dde3..95fe289 100644 --- a/src/XML/wsam/UsingAddressing.php +++ b/src/XML/wsam/UsingAddressing.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsam; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; @@ -42,12 +42,12 @@ final public function __construct( /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -59,9 +59,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this UsingAddressing to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); diff --git a/src/XML/wsaw/AbstractAnonymousType.php b/src/XML/wsaw/AbstractAnonymousType.php index 4ba2faf..1d96d68 100644 --- a/src/XML/wsaw/AbstractAnonymousType.php +++ b/src/XML/wsaw/AbstractAnonymousType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom\Element; /** * Abstract class defining the Anonymous type @@ -36,9 +36,9 @@ public function getValue(): AnonymousEnum /** * Convert this Anomymous to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getValue()->value; diff --git a/src/XML/wsaw/AbstractAttributedQNameType.php b/src/XML/wsaw/AbstractAttributedQNameType.php index a580042..a72b7e5 100644 --- a/src/XML/wsaw/AbstractAttributedQNameType.php +++ b/src/XML/wsaw/AbstractAttributedQNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\QNameValue; @@ -45,9 +45,9 @@ public function __construct( /** * Convert this AttributedQNameType to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsaw/AbstractServiceNameType.php b/src/XML/wsaw/AbstractServiceNameType.php index 8b54b91..871ccd5 100644 --- a/src/XML/wsaw/AbstractServiceNameType.php +++ b/src/XML/wsaw/AbstractServiceNameType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\TypedTextContentTrait; use SimpleSAML\XMLSchema\Type\NCNameValue; @@ -59,9 +59,9 @@ public function getEndpointName(): ?NCNameValue /** * Convert this ServiceNameType to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); $e->textContent = $this->getContent()->getValue(); diff --git a/src/XML/wsaw/Anonymous.php b/src/XML/wsaw/Anonymous.php index 1ff38e7..30af241 100644 --- a/src/XML/wsaw/Anonymous.php +++ b/src/XML/wsaw/Anonymous.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; @@ -49,12 +49,12 @@ final public function __construct( /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -74,9 +74,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this Anonymous to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = parent::toXML($parent); diff --git a/src/XML/wsaw/InterfaceName.php b/src/XML/wsaw/InterfaceName.php index c8d1783..af02807 100644 --- a/src/XML/wsaw/InterfaceName.php +++ b/src/XML/wsaw/InterfaceName.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -24,12 +24,12 @@ final class InterfaceName extends AbstractAttributedQNameType implements SchemaV /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsaw/ServiceName.php b/src/XML/wsaw/ServiceName.php index d37ca97..b96a07a 100644 --- a/src/XML/wsaw/ServiceName.php +++ b/src/XML/wsaw/ServiceName.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\SchemaValidatableElementInterface; use SimpleSAML\XML\SchemaValidatableElementTrait; @@ -25,12 +25,12 @@ final class ServiceName extends AbstractServiceNameType implements SchemaValidat /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); diff --git a/src/XML/wsaw/UsingAddressing.php b/src/XML/wsaw/UsingAddressing.php index 2d0405e..c9b3b43 100644 --- a/src/XML/wsaw/UsingAddressing.php +++ b/src/XML/wsaw/UsingAddressing.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use DOMElement; +use Dom; use SimpleSAML\WebServices\Addressing\Assert\Assert; use SimpleSAML\XML\ExtendableAttributesTrait; use SimpleSAML\XML\SchemaValidatableElementInterface; @@ -42,12 +42,12 @@ final public function __construct( /** * Create an instance of this object from its XML representation. * - * @param \DOMElement $xml + * @param \Dom\Element $xml * * @throws \SimpleSAML\XMLSchema\Exception\InvalidDOMElementException * if the qualified name of the supplied element is wrong */ - public static function fromXML(DOMElement $xml): static + public static function fromXML(Dom\Element $xml): static { Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); @@ -59,9 +59,9 @@ public static function fromXML(DOMElement $xml): static /** * Convert this UsingAddressing to XML. * - * @param \DOMElement|null $parent The element we should append this class to. + * @param \Dom\Element|null $parent The element we should append this class to. */ - public function toXML(?DOMElement $parent = null): DOMElement + public function toXML(?Dom\Element $parent = null): Dom\Element { $e = $this->instantiateParentElement($parent); From 442f241a6d4c7fd08daf2af8637bb302e8809b0d Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 11 Jun 2026 00:28:03 +0200 Subject: [PATCH 3/3] Migrate DOM-classes to PHP 8.4's new DOM-API --- .../AbstractAttributedQNameType.php | 7 ++++-- .../wsa_200408/AbstractAttributedURIType.php | 5 +++- .../wsa_200408/AbstractRelationshipType.php | 2 +- src/XML/wsa_200408/AbstractRetryAfterType.php | 5 +++- .../wsa_200408/AbstractServiceNameType.php | 2 +- .../AbstractAttributedQNameType.php | 5 +++- .../wsa_200508/AbstractAttributedURIType.php | 5 +++- .../AbstractAttributedUnsignedLongType.php | 5 +++- src/XML/wsa_200508/RelatesTo.php | 2 +- src/XML/wsam/InterfaceName.php | 2 +- src/XML/wsam/ServiceName.php | 2 +- src/XML/wsaw/AbstractAnonymousType.php | 2 +- src/XML/wsaw/Anonymous.php | 4 +-- src/XML/wsaw/InterfaceName.php | 2 +- src/XML/wsaw/ServiceName.php | 2 +- .../Addressing/XML/wsa_200408/ActionTest.php | 9 ++++--- .../Addressing/XML/wsa_200408/AddressTest.php | 11 ++++---- .../XML/wsa_200408/EndpointReferenceTest.php | 25 ++++++++++--------- .../Addressing/XML/wsa_200408/FaultToTest.php | 25 ++++++++++--------- tests/Addressing/XML/wsa_200408/FromTest.php | 25 ++++++++++--------- .../XML/wsa_200408/MessageIDTest.php | 11 ++++---- .../XML/wsa_200408/PortTypeTest.php | 9 ++++--- .../wsa_200408/ReferenceParametersTest.php | 15 +++++------ .../wsa_200408/ReferencePropertiesTest.php | 19 +++++++------- .../XML/wsa_200408/RelatesToTest.php | 9 ++++--- .../Addressing/XML/wsa_200408/ReplyToTest.php | 25 ++++++++++--------- .../XML/wsa_200408/RetryAfterTest.php | 9 ++++--- .../XML/wsa_200408/ServiceNameTest.php | 9 ++++--- tests/Addressing/XML/wsa_200408/ToTest.php | 11 ++++---- .../Addressing/XML/wsa_200508/ActionTest.php | 9 ++++--- .../Addressing/XML/wsa_200508/AddressTest.php | 9 ++++--- .../XML/wsa_200508/EndpointReferenceTest.php | 23 +++++++++-------- .../Addressing/XML/wsa_200508/FaultToTest.php | 23 +++++++++-------- tests/Addressing/XML/wsa_200508/FromTest.php | 23 +++++++++-------- .../XML/wsa_200508/MessageIDTest.php | 9 ++++--- .../XML/wsa_200508/MetadataTest.php | 15 +++++------ .../XML/wsa_200508/ProblemActionTest.php | 9 ++++--- .../XML/wsa_200508/ProblemHeaderQNameTest.php | 9 ++++--- .../XML/wsa_200508/ProblemIRITest.php | 9 ++++--- .../wsa_200508/ReferenceParametersTest.php | 15 +++++------ .../XML/wsa_200508/RelatesToTest.php | 9 ++++--- .../Addressing/XML/wsa_200508/ReplyToTest.php | 23 +++++++++-------- .../XML/wsa_200508/RetryAfterTest.php | 9 ++++--- .../XML/wsa_200508/SoapActionTest.php | 9 ++++--- tests/Addressing/XML/wsa_200508/ToTest.php | 9 ++++--- tests/Addressing/XML/wsam/AddressingTest.php | 9 ++++--- .../XML/wsam/AnonymousResponsesTest.php | 9 ++++--- .../Addressing/XML/wsam/InterfaceNameTest.php | 9 ++++--- .../XML/wsam/NonAnonymousResponsesTest.php | 9 ++++--- tests/Addressing/XML/wsam/ServiceNameTest.php | 9 ++++--- tests/Addressing/XML/wsaw/AnonymousTest.php | 9 ++++--- .../Addressing/XML/wsaw/InterfaceNameTest.php | 9 ++++--- tests/Addressing/XML/wsaw/ServiceNameTest.php | 9 ++++--- .../XML/wsaw/UsingAddressingTest.php | 9 ++++--- 54 files changed, 307 insertions(+), 250 deletions(-) diff --git a/src/XML/wsa_200408/AbstractAttributedQNameType.php b/src/XML/wsa_200408/AbstractAttributedQNameType.php index 20229f3..7271454 100644 --- a/src/XML/wsa_200408/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200408/AbstractAttributedQNameType.php @@ -59,14 +59,17 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml)); + return new static( + QNameValue::fromDocument((string)$xml->textContent, $xml), + self::getAttributesNSFromXML($xml), + ); } /** * Convert this element to XML. * - * @param \Dom\lement|null $parent The element we should append this element to. + * @param \Dom\Element|null $parent The element we should append this element to. */ public function toXML(?Dom\Element $parent = null): Dom\Element { diff --git a/src/XML/wsa_200408/AbstractAttributedURIType.php b/src/XML/wsa_200408/AbstractAttributedURIType.php index 6f6924c..37c76cc 100644 --- a/src/XML/wsa_200408/AbstractAttributedURIType.php +++ b/src/XML/wsa_200408/AbstractAttributedURIType.php @@ -59,7 +59,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); + return new static( + AnyURIValue::fromString((string)$xml->textContent), + self::getAttributesNSFromXML($xml), + ); } diff --git a/src/XML/wsa_200408/AbstractRelationshipType.php b/src/XML/wsa_200408/AbstractRelationshipType.php index 8490413..0c746f5 100644 --- a/src/XML/wsa_200408/AbstractRelationshipType.php +++ b/src/XML/wsa_200408/AbstractRelationshipType.php @@ -74,7 +74,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - AnyURIValue::fromString($xml->textContent), + AnyURIValue::fromString((string)$xml->textContent), self::getOptionalAttribute($xml, 'RelationshipType', QNameValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsa_200408/AbstractRetryAfterType.php b/src/XML/wsa_200408/AbstractRetryAfterType.php index 470d177..9130173 100644 --- a/src/XML/wsa_200408/AbstractRetryAfterType.php +++ b/src/XML/wsa_200408/AbstractRetryAfterType.php @@ -61,7 +61,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(NonNegativeIntegerValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); + return new static( + NonNegativeIntegerValue::fromString((string)$xml->textContent), + self::getAttributesNSFromXML($xml), + ); } diff --git a/src/XML/wsa_200408/AbstractServiceNameType.php b/src/XML/wsa_200408/AbstractServiceNameType.php index bb3975f..aacff49 100644 --- a/src/XML/wsa_200408/AbstractServiceNameType.php +++ b/src/XML/wsa_200408/AbstractServiceNameType.php @@ -74,7 +74,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - QNameValue::fromDocument($xml->textContent, $xml), + QNameValue::fromDocument((string)$xml->textContent, $xml), self::getOptionalAttribute($xml, 'PortName', NCNameValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsa_200508/AbstractAttributedQNameType.php b/src/XML/wsa_200508/AbstractAttributedQNameType.php index b57f032..1c4b41f 100644 --- a/src/XML/wsa_200508/AbstractAttributedQNameType.php +++ b/src/XML/wsa_200508/AbstractAttributedQNameType.php @@ -59,7 +59,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(QNameValue::fromDocument($xml->textContent, $xml), self::getAttributesNSFromXML($xml)); + return new static( + QNameValue::fromDocument((string)$xml->textContent, $xml), + self::getAttributesNSFromXML($xml), + ); } diff --git a/src/XML/wsa_200508/AbstractAttributedURIType.php b/src/XML/wsa_200508/AbstractAttributedURIType.php index a05be0b..26dff5e 100644 --- a/src/XML/wsa_200508/AbstractAttributedURIType.php +++ b/src/XML/wsa_200508/AbstractAttributedURIType.php @@ -59,7 +59,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(AnyURIValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); + return new static( + AnyURIValue::fromString((string)$xml->textContent), + self::getAttributesNSFromXML($xml), + ); } diff --git a/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php index 5d97ed0..39da3df 100644 --- a/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php +++ b/src/XML/wsa_200508/AbstractAttributedUnsignedLongType.php @@ -59,7 +59,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->localName, static::getLocalName(), InvalidDOMElementException::class); Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); - return new static(UnsignedLongValue::fromString($xml->textContent), self::getAttributesNSFromXML($xml)); + return new static( + UnsignedLongValue::fromString((string)$xml->textContent), + self::getAttributesNSFromXML($xml), + ); } diff --git a/src/XML/wsa_200508/RelatesTo.php b/src/XML/wsa_200508/RelatesTo.php index 1fe0a8c..6a24b73 100644 --- a/src/XML/wsa_200508/RelatesTo.php +++ b/src/XML/wsa_200508/RelatesTo.php @@ -74,7 +74,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - AnyURIValue::fromString($xml->textContent), + AnyURIValue::fromString((string)$xml->textContent), self::getOptionalAttribute($xml, 'RelationshipType', AnyURIValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsam/InterfaceName.php b/src/XML/wsam/InterfaceName.php index a81d218..1f44140 100644 --- a/src/XML/wsam/InterfaceName.php +++ b/src/XML/wsam/InterfaceName.php @@ -35,7 +35,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - QNameValue::fromDocument($xml->textContent, $xml), + QNameValue::fromDocument((string)$xml->textContent, $xml), self::getAttributesNSFromXML($xml), ); } diff --git a/src/XML/wsam/ServiceName.php b/src/XML/wsam/ServiceName.php index 3a2c717..038bfc3 100644 --- a/src/XML/wsam/ServiceName.php +++ b/src/XML/wsam/ServiceName.php @@ -36,7 +36,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - QNameValue::fromDocument($xml->textContent, $xml), + QNameValue::fromDocument((string)$xml->textContent, $xml), self::getOptionalAttribute($xml, 'EndpointName', NCNameValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/src/XML/wsaw/AbstractAnonymousType.php b/src/XML/wsaw/AbstractAnonymousType.php index 1d96d68..5531741 100644 --- a/src/XML/wsaw/AbstractAnonymousType.php +++ b/src/XML/wsaw/AbstractAnonymousType.php @@ -4,7 +4,7 @@ namespace SimpleSAML\WebServices\Addressing\XML\wsaw; -use Dom\Element; +use Dom; /** * Abstract class defining the Anonymous type diff --git a/src/XML/wsaw/Anonymous.php b/src/XML/wsaw/Anonymous.php index 30af241..feab585 100644 --- a/src/XML/wsaw/Anonymous.php +++ b/src/XML/wsaw/Anonymous.php @@ -60,10 +60,10 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); try { - $anonymous = AnonymousEnum::from($xml->textContent); + $anonymous = AnonymousEnum::from((string)$xml->textContent); } catch (ValueError) { throw new SchemaViolationException( - sprintf('Unknown value \'%s\' for Anonymous element.', $xml->textContent), + sprintf('Unknown value \'%s\' for Anonymous element.', (string)$xml->textContent), ); } diff --git a/src/XML/wsaw/InterfaceName.php b/src/XML/wsaw/InterfaceName.php index af02807..f6aa207 100644 --- a/src/XML/wsaw/InterfaceName.php +++ b/src/XML/wsaw/InterfaceName.php @@ -35,7 +35,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - QNameValue::fromDocument($xml->textContent, $xml), + QNameValue::fromDocument((string)$xml->textContent, $xml), self::getAttributesNSFromXML($xml), ); } diff --git a/src/XML/wsaw/ServiceName.php b/src/XML/wsaw/ServiceName.php index b96a07a..c903cec 100644 --- a/src/XML/wsaw/ServiceName.php +++ b/src/XML/wsaw/ServiceName.php @@ -36,7 +36,7 @@ public static function fromXML(Dom\Element $xml): static Assert::same($xml->namespaceURI, static::NS, InvalidDOMElementException::class); return new static( - QNameValue::fromDocument($xml->textContent, $xml), + QNameValue::fromDocument((string) $xml->textContent, $xml), self::getOptionalAttribute($xml, 'EndpointName', NCNameValue::class, null), self::getAttributesNSFromXML($xml), ); diff --git a/tests/Addressing/XML/wsa_200408/ActionTest.php b/tests/Addressing/XML/wsa_200408/ActionTest.php index 53383a5..4d291c5 100644 --- a/tests/Addressing/XML/wsa_200408/ActionTest.php +++ b/tests/Addressing/XML/wsa_200408/ActionTest.php @@ -58,9 +58,10 @@ public function testMarshalling(): void $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $action = new Action(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($action), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($action); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/AddressTest.php b/tests/Addressing/XML/wsa_200408/AddressTest.php index 098411c..11890bd 100644 --- a/tests/Addressing/XML/wsa_200408/AddressTest.php +++ b/tests/Addressing/XML/wsa_200408/AddressTest.php @@ -54,11 +54,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); - $Address = new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); + $address = new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($Address), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($address); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/EndpointReferenceTest.php b/tests/Addressing/XML/wsa_200408/EndpointReferenceTest.php index 183f759..ba22e9b 100644 --- a/tests/Addressing/XML/wsa_200408/EndpointReferenceTest.php +++ b/tests/Addressing/XML/wsa_200408/EndpointReferenceTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -45,14 +45,14 @@ final class EndpointReferenceTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referencePropertiesContent */ - protected static DOMElement $referencePropertiesContent; + /** @var \Dom\Element $referencePropertiesContent */ + protected static Dom\Element $referencePropertiesContent; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -113,10 +113,11 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($endpointReference), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($endpointReference); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -158,7 +159,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $endpointReferenceElements); // Test ordering of EndpointReference contents - /** @var \DOMElement[] $endpointReferenceElements */ + /** @var \Dom\Element[] $endpointReferenceElements */ $endpointReferenceElements = XPath::xpQuery( $endpointReferenceElement, './wsa:Address/following-sibling::*', diff --git a/tests/Addressing/XML/wsa_200408/FaultToTest.php b/tests/Addressing/XML/wsa_200408/FaultToTest.php index 6f79ec5..12897e8 100644 --- a/tests/Addressing/XML/wsa_200408/FaultToTest.php +++ b/tests/Addressing/XML/wsa_200408/FaultToTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -45,14 +45,14 @@ final class FaultToTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referencePropertiesContent */ - protected static DOMElement $referencePropertiesContent; + /** @var \Dom\Element $referencePropertiesContent */ + protected static Dom\Element $referencePropertiesContent; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -113,10 +113,11 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($faultTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($faultTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -158,7 +159,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $faultToElements); // Test ordering of FaultTo contents - /** @var \DOMElement[] $faultToElements */ + /** @var \Dom\Element[] $faultToElements */ $faultToElements = XPath::xpQuery($faultToElement, './wsa:Address/following-sibling::*', $xpCache); $this->assertCount(5, $faultToElements); diff --git a/tests/Addressing/XML/wsa_200408/FromTest.php b/tests/Addressing/XML/wsa_200408/FromTest.php index 82d614c..4b29abc 100644 --- a/tests/Addressing/XML/wsa_200408/FromTest.php +++ b/tests/Addressing/XML/wsa_200408/FromTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -45,14 +45,14 @@ final class FromTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referencePropertiesContent */ - protected static DOMElement $referencePropertiesContent; + /** @var \Dom\Element $referencePropertiesContent */ + protected static Dom\Element $referencePropertiesContent; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -113,10 +113,11 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($from), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($from); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -158,7 +159,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $fromElements); // Test ordering of From contents - /** @var \DOMElement[] $fromElements */ + /** @var \Dom\Element[] $fromElements */ $fromElements = XPath::xpQuery($fromElement, './wsa:Address/following-sibling::*', $xpCache); $this->assertCount(5, $fromElements); diff --git a/tests/Addressing/XML/wsa_200408/MessageIDTest.php b/tests/Addressing/XML/wsa_200408/MessageIDTest.php index 0844c4b..d6c94f9 100644 --- a/tests/Addressing/XML/wsa_200408/MessageIDTest.php +++ b/tests/Addressing/XML/wsa_200408/MessageIDTest.php @@ -56,11 +56,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); - $MessageID = new MessageID(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); + $messageId = new MessageID(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($MessageID), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($messageId); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/PortTypeTest.php b/tests/Addressing/XML/wsa_200408/PortTypeTest.php index da694ad..fdcd2a4 100644 --- a/tests/Addressing/XML/wsa_200408/PortTypeTest.php +++ b/tests/Addressing/XML/wsa_200408/PortTypeTest.php @@ -56,9 +56,10 @@ public function testMarshalling(): void $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $portType = new PortType(QNameValue::fromString('{urn:x-simplesamlphp:namespace}ssp:Chunk'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($portType), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($portType); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/ReferenceParametersTest.php b/tests/Addressing/XML/wsa_200408/ReferenceParametersTest.php index 01ab626..bbdeb55 100644 --- a/tests/Addressing/XML/wsa_200408/ReferenceParametersTest.php +++ b/tests/Addressing/XML/wsa_200408/ReferenceParametersTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -30,8 +30,8 @@ final class ReferenceParametersTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - private static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + private static Dom\Element $referenceParametersContent; /** @@ -57,10 +57,11 @@ public function testMarshalling(): void $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)]); $this->assertFalse($referenceParameters->isEmptyElement()); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($referenceParameters), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($referenceParameters); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/Addressing/XML/wsa_200408/ReferencePropertiesTest.php b/tests/Addressing/XML/wsa_200408/ReferencePropertiesTest.php index e5b36e3..5095c44 100644 --- a/tests/Addressing/XML/wsa_200408/ReferencePropertiesTest.php +++ b/tests/Addressing/XML/wsa_200408/ReferencePropertiesTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -30,8 +30,8 @@ final class ReferencePropertiesTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $ReferencePropertiesContent */ - private static DOMElement $ReferencePropertiesContent; + /** @var \Dom\Element $ReferencePropertiesContent */ + private static Dom\Element $ReferencePropertiesContent; /** @@ -54,13 +54,14 @@ public static function setUpBeforeClass(): void */ public function testMarshalling(): void { - $ReferenceProperties = new ReferenceProperties([new Chunk(self::$ReferencePropertiesContent)]); - $this->assertFalse($ReferenceProperties->isEmptyElement()); + $referenceProperties = new ReferenceProperties([new Chunk(self::$ReferencePropertiesContent)]); + $this->assertFalse($referenceProperties->isEmptyElement()); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($ReferenceProperties), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($referenceProperties); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/Addressing/XML/wsa_200408/RelatesToTest.php b/tests/Addressing/XML/wsa_200408/RelatesToTest.php index 468d49f..f41b44f 100644 --- a/tests/Addressing/XML/wsa_200408/RelatesToTest.php +++ b/tests/Addressing/XML/wsa_200408/RelatesToTest.php @@ -63,9 +63,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($relatesTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($relatesTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/ReplyToTest.php b/tests/Addressing/XML/wsa_200408/ReplyToTest.php index b684b39..581759f 100644 --- a/tests/Addressing/XML/wsa_200408/ReplyToTest.php +++ b/tests/Addressing/XML/wsa_200408/ReplyToTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200408; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -45,14 +45,14 @@ final class ReplyToTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referencePropertiesContent */ - protected static DOMElement $referencePropertiesContent; + /** @var \Dom\Element $referencePropertiesContent */ + protected static Dom\Element $referencePropertiesContent; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -113,10 +113,11 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($replyTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($replyTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } @@ -158,7 +159,7 @@ public function testMarshallingElementOrdering(): void $this->assertCount(1, $replyToElements); // Test ordering of ReplyTo contents - /** @var \DOMElement[] $replyToElements */ + /** @var \Dom\Element[] $replyToElements */ $replyToElements = XPath::xpQuery($replyToElement, './wsa:Address/following-sibling::*', $xpCache); $this->assertCount(5, $replyToElements); diff --git a/tests/Addressing/XML/wsa_200408/RetryAfterTest.php b/tests/Addressing/XML/wsa_200408/RetryAfterTest.php index a23c73a..8148299 100644 --- a/tests/Addressing/XML/wsa_200408/RetryAfterTest.php +++ b/tests/Addressing/XML/wsa_200408/RetryAfterTest.php @@ -54,9 +54,10 @@ public function testMarshalling(): void { $retryAfter = RetryAfter::fromString('30'); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($retryAfter), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($retryAfter); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/ServiceNameTest.php b/tests/Addressing/XML/wsa_200408/ServiceNameTest.php index 2bfe5a9..6aeb577 100644 --- a/tests/Addressing/XML/wsa_200408/ServiceNameTest.php +++ b/tests/Addressing/XML/wsa_200408/ServiceNameTest.php @@ -61,9 +61,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($serviceName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($serviceName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200408/ToTest.php b/tests/Addressing/XML/wsa_200408/ToTest.php index 67289ae..b494d74 100644 --- a/tests/Addressing/XML/wsa_200408/ToTest.php +++ b/tests/Addressing/XML/wsa_200408/ToTest.php @@ -56,11 +56,12 @@ public static function setUpBeforeClass(): void public function testMarshalling(): void { $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); - $To = new To(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); + $to = new To(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($To), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($to); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/ActionTest.php b/tests/Addressing/XML/wsa_200508/ActionTest.php index 3baae12..06cf59a 100644 --- a/tests/Addressing/XML/wsa_200508/ActionTest.php +++ b/tests/Addressing/XML/wsa_200508/ActionTest.php @@ -58,9 +58,10 @@ public function testMarshalling(): void $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $action = new Action(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($action), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($action); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/AddressTest.php b/tests/Addressing/XML/wsa_200508/AddressTest.php index 58a091d..96a75ce 100644 --- a/tests/Addressing/XML/wsa_200508/AddressTest.php +++ b/tests/Addressing/XML/wsa_200508/AddressTest.php @@ -56,9 +56,10 @@ public function testMarshalling(): void $attr1 = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $address = new Address(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($address), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($address); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/EndpointReferenceTest.php b/tests/Addressing/XML/wsa_200508/EndpointReferenceTest.php index 4f4a1aa..12b9713 100644 --- a/tests/Addressing/XML/wsa_200508/EndpointReferenceTest.php +++ b/tests/Addressing/XML/wsa_200508/EndpointReferenceTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -40,14 +40,14 @@ final class EndpointReferenceTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $metadataContent */ - protected static DOMElement $metadataContent; + /** @var \Dom\Element $metadataContent */ + protected static Dom\Element $metadataContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -99,9 +99,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($endpointReference), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($endpointReference); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/FaultToTest.php b/tests/Addressing/XML/wsa_200508/FaultToTest.php index ea5431a..a2dd26a 100644 --- a/tests/Addressing/XML/wsa_200508/FaultToTest.php +++ b/tests/Addressing/XML/wsa_200508/FaultToTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -40,14 +40,14 @@ final class FaultToTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $metadataContent */ - protected static DOMElement $metadataContent; + /** @var \Dom\Element $metadataContent */ + protected static Dom\Element $metadataContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -101,9 +101,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($faultTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($faultTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/FromTest.php b/tests/Addressing/XML/wsa_200508/FromTest.php index 5984bee..9e88be6 100644 --- a/tests/Addressing/XML/wsa_200508/FromTest.php +++ b/tests/Addressing/XML/wsa_200508/FromTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -40,14 +40,14 @@ final class FromTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $metadataContent */ - protected static DOMElement $metadataContent; + /** @var \Dom\Element $metadataContent */ + protected static Dom\Element $metadataContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -101,9 +101,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($from), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($from); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/MessageIDTest.php b/tests/Addressing/XML/wsa_200508/MessageIDTest.php index a49f5b9..b733ca7 100644 --- a/tests/Addressing/XML/wsa_200508/MessageIDTest.php +++ b/tests/Addressing/XML/wsa_200508/MessageIDTest.php @@ -60,9 +60,10 @@ public function testMarshalling(): void [$mustUnderstand->toAttribute()], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($msgId), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($msgId); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/MetadataTest.php b/tests/Addressing/XML/wsa_200508/MetadataTest.php index a049dc0..1d1d53c 100644 --- a/tests/Addressing/XML/wsa_200508/MetadataTest.php +++ b/tests/Addressing/XML/wsa_200508/MetadataTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -34,8 +34,8 @@ final class MetadataTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $MetadataContent */ - private static DOMElement $metadataContent; + /** @var \Dom\Element $MetadataContent */ + private static Dom\Element $metadataContent; /** @@ -63,10 +63,11 @@ public function testMarshalling(): void $metadata = new Metadata([new Chunk(self::$metadataContent)], [$domAttr]); $this->assertFalse($metadata->isEmptyElement()); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($metadata), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($metadata); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/Addressing/XML/wsa_200508/ProblemActionTest.php b/tests/Addressing/XML/wsa_200508/ProblemActionTest.php index d65f0ba..e868d26 100644 --- a/tests/Addressing/XML/wsa_200508/ProblemActionTest.php +++ b/tests/Addressing/XML/wsa_200508/ProblemActionTest.php @@ -66,10 +66,11 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($problemAction), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($problemAction); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/Addressing/XML/wsa_200508/ProblemHeaderQNameTest.php b/tests/Addressing/XML/wsa_200508/ProblemHeaderQNameTest.php index b793fb5..bdbb967 100644 --- a/tests/Addressing/XML/wsa_200508/ProblemHeaderQNameTest.php +++ b/tests/Addressing/XML/wsa_200508/ProblemHeaderQNameTest.php @@ -68,9 +68,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($problemHeaderQName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($problemHeaderQName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/ProblemIRITest.php b/tests/Addressing/XML/wsa_200508/ProblemIRITest.php index d25978b..a6ea8b4 100644 --- a/tests/Addressing/XML/wsa_200508/ProblemIRITest.php +++ b/tests/Addressing/XML/wsa_200508/ProblemIRITest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void $problemIri = new ProblemIRI(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr1]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($problemIri), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($problemIri); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/ReferenceParametersTest.php b/tests/Addressing/XML/wsa_200508/ReferenceParametersTest.php index f3db566..bbcb646 100644 --- a/tests/Addressing/XML/wsa_200508/ReferenceParametersTest.php +++ b/tests/Addressing/XML/wsa_200508/ReferenceParametersTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -34,8 +34,8 @@ final class ReferenceParametersTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - private static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + private static Dom\Element $referenceParametersContent; /** @@ -63,10 +63,11 @@ public function testMarshalling(): void $referenceParameters = new ReferenceParameters([new Chunk(self::$referenceParametersContent)], [$domAttr]); $this->assertFalse($referenceParameters->isEmptyElement()); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($referenceParameters), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($referenceParameters); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } diff --git a/tests/Addressing/XML/wsa_200508/RelatesToTest.php b/tests/Addressing/XML/wsa_200508/RelatesToTest.php index 557d79d..0461782 100644 --- a/tests/Addressing/XML/wsa_200508/RelatesToTest.php +++ b/tests/Addressing/XML/wsa_200508/RelatesToTest.php @@ -57,9 +57,10 @@ public function testMarshalling(): void [$domAttr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($relatesTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($relatesTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/ReplyToTest.php b/tests/Addressing/XML/wsa_200508/ReplyToTest.php index 63d2cfb..333395a 100644 --- a/tests/Addressing/XML/wsa_200508/ReplyToTest.php +++ b/tests/Addressing/XML/wsa_200508/ReplyToTest.php @@ -4,7 +4,7 @@ namespace SimpleSAML\Test\WebServices\Addressing\XML\wsa_200508; -use DOMElement; +use Dom; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; @@ -40,14 +40,14 @@ final class ReplyToTest extends TestCase use SerializableElementTestTrait; - /** @var \DOMElement $referenceParametersContent */ - protected static DOMElement $referenceParametersContent; + /** @var \Dom\Element $referenceParametersContent */ + protected static Dom\Element $referenceParametersContent; - /** @var \DOMElement $metadataContent */ - protected static DOMElement $metadataContent; + /** @var \Dom\Element $metadataContent */ + protected static Dom\Element $metadataContent; - /** @var \DOMElement $customContent */ - protected static DOMElement $customContent; + /** @var \Dom\Element $customContent */ + protected static Dom\Element $customContent; /** @@ -101,9 +101,10 @@ public function testMarshalling(): void [$attr1], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($replyTo), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($replyTo); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/RetryAfterTest.php b/tests/Addressing/XML/wsa_200508/RetryAfterTest.php index 22f2446..3ec89a5 100644 --- a/tests/Addressing/XML/wsa_200508/RetryAfterTest.php +++ b/tests/Addressing/XML/wsa_200508/RetryAfterTest.php @@ -58,9 +58,10 @@ public function testMarshalling(): void $attr = new Attribute('urn:x-simplesamlphp:namespace', 'ssp', 'test', StringValue::fromString('value')); $retryAfter = new RetryAfter(UnsignedLongValue::fromString('1234567890'), [$attr]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($retryAfter), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($retryAfter); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/SoapActionTest.php b/tests/Addressing/XML/wsa_200508/SoapActionTest.php index b3f5051..5ebf359 100644 --- a/tests/Addressing/XML/wsa_200508/SoapActionTest.php +++ b/tests/Addressing/XML/wsa_200508/SoapActionTest.php @@ -51,9 +51,10 @@ public function testMarshalling(): void { $soapAction = new SoapAction(AnyURIValue::fromString('http://www.example.com/')); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($soapAction), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($soapAction); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsa_200508/ToTest.php b/tests/Addressing/XML/wsa_200508/ToTest.php index b08c6c9..2e2e51b 100644 --- a/tests/Addressing/XML/wsa_200508/ToTest.php +++ b/tests/Addressing/XML/wsa_200508/ToTest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void $to = new To(AnyURIValue::fromString('https://login.microsoftonline.com/login.srf'), [$attr]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($to), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($to); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsam/AddressingTest.php b/tests/Addressing/XML/wsam/AddressingTest.php index b083222..57453d8 100644 --- a/tests/Addressing/XML/wsam/AddressingTest.php +++ b/tests/Addressing/XML/wsam/AddressingTest.php @@ -76,9 +76,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($addressing), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($addressing); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsam/AnonymousResponsesTest.php b/tests/Addressing/XML/wsam/AnonymousResponsesTest.php index 61e85a8..d39b1c6 100644 --- a/tests/Addressing/XML/wsam/AnonymousResponsesTest.php +++ b/tests/Addressing/XML/wsam/AnonymousResponsesTest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($anonymousResponses), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($anonymousResponses); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsam/InterfaceNameTest.php b/tests/Addressing/XML/wsam/InterfaceNameTest.php index 242cb0f..469b255 100644 --- a/tests/Addressing/XML/wsam/InterfaceNameTest.php +++ b/tests/Addressing/XML/wsam/InterfaceNameTest.php @@ -61,9 +61,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($interfaceName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($interfaceName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsam/NonAnonymousResponsesTest.php b/tests/Addressing/XML/wsam/NonAnonymousResponsesTest.php index 7d166e9..aa2f4a3 100644 --- a/tests/Addressing/XML/wsam/NonAnonymousResponsesTest.php +++ b/tests/Addressing/XML/wsam/NonAnonymousResponsesTest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($nonAnonymousResponses), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($nonAnonymousResponses); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsam/ServiceNameTest.php b/tests/Addressing/XML/wsam/ServiceNameTest.php index 326be61..f245199 100644 --- a/tests/Addressing/XML/wsam/ServiceNameTest.php +++ b/tests/Addressing/XML/wsam/ServiceNameTest.php @@ -63,9 +63,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($serviceName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($serviceName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsaw/AnonymousTest.php b/tests/Addressing/XML/wsaw/AnonymousTest.php index 5315b0a..8c4d19e 100644 --- a/tests/Addressing/XML/wsaw/AnonymousTest.php +++ b/tests/Addressing/XML/wsaw/AnonymousTest.php @@ -59,9 +59,10 @@ public function testMarshalling(): void $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $anonymous = new Anonymous(AnonymousEnum::Prohibited, [$attr]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($anonymous), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($anonymous); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsaw/InterfaceNameTest.php b/tests/Addressing/XML/wsaw/InterfaceNameTest.php index 85641d1..cd88770 100644 --- a/tests/Addressing/XML/wsaw/InterfaceNameTest.php +++ b/tests/Addressing/XML/wsaw/InterfaceNameTest.php @@ -61,9 +61,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($interfaceName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($interfaceName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsaw/ServiceNameTest.php b/tests/Addressing/XML/wsaw/ServiceNameTest.php index a74e85e..3865203 100644 --- a/tests/Addressing/XML/wsaw/ServiceNameTest.php +++ b/tests/Addressing/XML/wsaw/ServiceNameTest.php @@ -63,9 +63,10 @@ public function testMarshalling(): void [$attr], ); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($serviceName), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($serviceName); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } } diff --git a/tests/Addressing/XML/wsaw/UsingAddressingTest.php b/tests/Addressing/XML/wsaw/UsingAddressingTest.php index dff45a5..94a8fab 100644 --- a/tests/Addressing/XML/wsaw/UsingAddressingTest.php +++ b/tests/Addressing/XML/wsaw/UsingAddressingTest.php @@ -55,9 +55,10 @@ public function testMarshalling(): void $attr = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', StringValue::fromString('value1')); $usingAddressing = new UsingAddressing([$attr]); - $this->assertEquals( - self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), - strval($usingAddressing), - ); + $expectedXml = self::$xmlRepresentation->saveXml(self::$xmlRepresentation->documentElement); + $this->assertNotFalse($expectedXml); + $actualXml = strval($usingAddressing); + + $this->assertXmlStringEqualsXmlString($expectedXml, $actualXml); } }