From f77d66df84064d4f7337dfe1e21600e2ee5139d0 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Thu, 25 Jan 2024 21:00:09 +0100 Subject: [PATCH] Raise coverage --- src/XML/fed/AbstractPseudonymBasisType.php | 12 ------------ .../XML/fed/ApplicationServiceEndpointTest.php | 1 + tests/WSSecurity/XML/wst/CodeTest.php | 1 + tests/WSSecurity/XML/wst/ComputedKeyTest.php | 1 + tests/WSSecurity/XML/wst/KeyTypeTest.php | 1 + tests/WSSecurity/XML/wst/ParticipantsTest.php | 2 +- tests/WSSecurity/XML/wst/SignChallengeTest.php | 11 +++++++++++ tests/WSSecurity/XML/wst/StatusTest.php | 1 + 8 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/XML/fed/AbstractPseudonymBasisType.php b/src/XML/fed/AbstractPseudonymBasisType.php index da250cb0..f104d4f6 100644 --- a/src/XML/fed/AbstractPseudonymBasisType.php +++ b/src/XML/fed/AbstractPseudonymBasisType.php @@ -47,18 +47,6 @@ final public function __construct( } - /** - * Test if an object, at the state it's in, would produce an empty XML-element - * - * @return bool - */ - public function isEmptyElement(): bool - { - return empty($this->getElements()) - && empty($this->getAttributesNS()); - } - - /** * Create an instance of this object from its XML representation. * diff --git a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php index 740d4f36..60c8ca37 100644 --- a/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php +++ b/tests/WSSecurity/XML/fed/ApplicationServiceEndpointTest.php @@ -24,6 +24,7 @@ * Tests for fed:ApplicationServiceEndpoint. * * @covers \SimpleSAML\WSSecurity\XML\fed\ApplicationServiceEndpoint + * @covers \SimpleSAML\WSSecurity\XML\fed\AbstractApplicationServiceEndpoint * @covers \SimpleSAML\WSSecurity\XML\fed\AbstractEndpointType * @covers \SimpleSAML\WSSecurity\XML\fed\AbstractFedElement * @package tvdijen/ws-security diff --git a/tests/WSSecurity/XML/wst/CodeTest.php b/tests/WSSecurity/XML/wst/CodeTest.php index 136b0f18..e642f03d 100644 --- a/tests/WSSecurity/XML/wst/CodeTest.php +++ b/tests/WSSecurity/XML/wst/CodeTest.php @@ -16,6 +16,7 @@ * Class \SimpleSAML\WSSecurity\XML\wst\CodeTest * * @covers \SimpleSAML\WSSecurity\XML\wst\Code + * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractStatusCodeTypeOpenEnum * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractWstElement * * @package tvdijen/ws-security diff --git a/tests/WSSecurity/XML/wst/ComputedKeyTest.php b/tests/WSSecurity/XML/wst/ComputedKeyTest.php index 75ad84c3..4b97b8b5 100644 --- a/tests/WSSecurity/XML/wst/ComputedKeyTest.php +++ b/tests/WSSecurity/XML/wst/ComputedKeyTest.php @@ -17,6 +17,7 @@ * Class \SimpleSAML\WSSecurity\XML\wst\ComputedKeyTest * * @covers \SimpleSAML\WSSecurity\XML\wst\ComputedKey + * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractComputedKeyOpenEnum * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractWstElement * * @package tvdijen/ws-security diff --git a/tests/WSSecurity/XML/wst/KeyTypeTest.php b/tests/WSSecurity/XML/wst/KeyTypeTest.php index de819055..fb299252 100644 --- a/tests/WSSecurity/XML/wst/KeyTypeTest.php +++ b/tests/WSSecurity/XML/wst/KeyTypeTest.php @@ -17,6 +17,7 @@ * Class \SimpleSAML\WSSecurity\XML\wst\KeyTypeTest * * @covers \SimpleSAML\WSSecurity\XML\wst\KeyType + * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractKeyTypeOpenEnum * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractWstElement * * @package tvdijen/ws-security diff --git a/tests/WSSecurity/XML/wst/ParticipantsTest.php b/tests/WSSecurity/XML/wst/ParticipantsTest.php index 544ff04d..35b192f0 100644 --- a/tests/WSSecurity/XML/wst/ParticipantsTest.php +++ b/tests/WSSecurity/XML/wst/ParticipantsTest.php @@ -21,7 +21,7 @@ * Class \SimpleSAML\WSSecurity\XML\wst\ParticipantsTest * * @covers \SimpleSAML\WSSecurity\XML\wst\Participants - * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractParticipantType + * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractParticipantsType * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractWstElement * * @package tvdijen/ws-security diff --git a/tests/WSSecurity/XML/wst/SignChallengeTest.php b/tests/WSSecurity/XML/wst/SignChallengeTest.php index cfa4c973..dcfb5a6e 100644 --- a/tests/WSSecurity/XML/wst/SignChallengeTest.php +++ b/tests/WSSecurity/XML/wst/SignChallengeTest.php @@ -66,4 +66,15 @@ public function testMarshalling(): void strval($signChallenge), ); } + + + /** + * Test creating an empty SignChallenge object from scratch. + */ + public function testMarshallingEmpty(): void + { + $signChallenge = new SignChallenge(); + + $this->assertTrue($signChallenge->isEmptyElement()); + } } diff --git a/tests/WSSecurity/XML/wst/StatusTest.php b/tests/WSSecurity/XML/wst/StatusTest.php index 8c907408..e8bdf923 100644 --- a/tests/WSSecurity/XML/wst/StatusTest.php +++ b/tests/WSSecurity/XML/wst/StatusTest.php @@ -19,6 +19,7 @@ * Class \SimpleSAML\WSSecurity\XML\wst\StatusTest * * @covers \SimpleSAML\WSSecurity\XML\wst\Status + * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractStatusType * @covers \SimpleSAML\WSSecurity\XML\wst\AbstractWstElement * * @package tvdijen/ws-security