From c86642c31f0a258a2dd0b0dd5efdadeebd60220f Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Tue, 8 Oct 2024 00:08:46 +0200 Subject: [PATCH] Raise coverage --- src/XML/soap12/AbstractHeader.php | 2 +- src/XML/soap12/AbstractOperation.php | 4 ++-- tests/WSDL/XML/soap12/BindingTest.php | 2 ++ tests/WSDL/XML/soap12/BodyTest.php | 2 ++ tests/WSDL/XML/soap12/HeaderTest.php | 1 + tests/WSDL/XML/soap12/OperationTest.php | 2 ++ tests/resources/xml/soap12/Header.xml | 2 +- 7 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/XML/soap12/AbstractHeader.php b/src/XML/soap12/AbstractHeader.php index 7476e92..f816ecd 100644 --- a/src/XML/soap12/AbstractHeader.php +++ b/src/XML/soap12/AbstractHeader.php @@ -145,7 +145,7 @@ public static function fromXML(DOMElement $xml): static */ public function toXML(DOMElement $parent = null): DOMElement { - $e = $this->instantiateParentElement($parent); + $e = parent::toXML($parent); $e->setAttribute('message', $this->getMessage()); $e->setAttribute('parts', $this->getParts()); diff --git a/src/XML/soap12/AbstractOperation.php b/src/XML/soap12/AbstractOperation.php index 6894850..b1d834d 100644 --- a/src/XML/soap12/AbstractOperation.php +++ b/src/XML/soap12/AbstractOperation.php @@ -142,8 +142,8 @@ public function toXML(DOMElement $parent = null): DOMElement $e->setAttribute('soapAction', $this->getSoapAction()); } - if ($this->getSoapAction() !== null) { - $e->setAttribute('soapActionRequired', $this->getSoapAction() ? 'true' : 'false'); + if ($this->getSoapActionRequired() !== null) { + $e->setAttribute('soapActionRequired', $this->getSoapActionRequired() ? 'true' : 'false'); } if ($this->getStyle() !== null) { diff --git a/tests/WSDL/XML/soap12/BindingTest.php b/tests/WSDL/XML/soap12/BindingTest.php index 569827b..074c825 100644 --- a/tests/WSDL/XML/soap12/BindingTest.php +++ b/tests/WSDL/XML/soap12/BindingTest.php @@ -62,5 +62,7 @@ public function testMarshalling(): void self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($binding), ); + + $this->assertFalse($binding->isEmptyElement()); } } diff --git a/tests/WSDL/XML/soap12/BodyTest.php b/tests/WSDL/XML/soap12/BodyTest.php index 88cf253..0aeb5f2 100644 --- a/tests/WSDL/XML/soap12/BodyTest.php +++ b/tests/WSDL/XML/soap12/BodyTest.php @@ -64,5 +64,7 @@ public function testMarshalling(): void self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($body), ); + + $this->assertFalse($body->isEmptyElement()); } } diff --git a/tests/WSDL/XML/soap12/HeaderTest.php b/tests/WSDL/XML/soap12/HeaderTest.php index a30f563..eb551cb 100644 --- a/tests/WSDL/XML/soap12/HeaderTest.php +++ b/tests/WSDL/XML/soap12/HeaderTest.php @@ -74,6 +74,7 @@ public function testMarshalling(): void [$headerFault], 'urn:x-simplesamlphp:coding', 'urn:x-simplesamlphp:namespace', + true, ); $this->assertEquals( diff --git a/tests/WSDL/XML/soap12/OperationTest.php b/tests/WSDL/XML/soap12/OperationTest.php index 2df5287..103c659 100644 --- a/tests/WSDL/XML/soap12/OperationTest.php +++ b/tests/WSDL/XML/soap12/OperationTest.php @@ -62,5 +62,7 @@ public function testMarshalling(): void self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($operation), ); + + $this->assertFalse($operation->isEmptyElement()); } } diff --git a/tests/resources/xml/soap12/Header.xml b/tests/resources/xml/soap12/Header.xml index cfc1813..d53c086 100644 --- a/tests/resources/xml/soap12/Header.xml +++ b/tests/resources/xml/soap12/Header.xml @@ -1,3 +1,3 @@ - +