From 0308d9400a245152ad7964c82c2f5f4cd06023a3 Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Sat, 30 Dec 2023 01:02:12 +0100 Subject: [PATCH] Raise coverage --- src/XML/sp/IncludeTokenOpenTypeTrait.php | 51 ------------------- tests/WSSecurity/XML/sp/HttpsTokenTest.php | 1 + tests/WSSecurity/XML/sp/IssuedTokenTest.php | 1 + tests/WSSecurity/XML/sp/KerberosTokenTest.php | 1 + tests/WSSecurity/XML/sp/KeyValueTokenTest.php | 1 + tests/WSSecurity/XML/sp/RelTokenTest.php | 1 + .../sp/RequestSecurityTokenTemplateTest.php | 7 ++- tests/WSSecurity/XML/sp/SamlTokenTest.php | 1 + .../XML/sp/SecurityContextTokenTest.php | 1 + tests/WSSecurity/XML/sp/UsernameTokenTest.php | 1 + tests/WSSecurity/XML/sp/X509TokenTest.php | 1 + 11 files changed, 15 insertions(+), 52 deletions(-) delete mode 100644 src/XML/sp/IncludeTokenOpenTypeTrait.php diff --git a/src/XML/sp/IncludeTokenOpenTypeTrait.php b/src/XML/sp/IncludeTokenOpenTypeTrait.php deleted file mode 100644 index 42663acb..00000000 --- a/src/XML/sp/IncludeTokenOpenTypeTrait.php +++ /dev/null @@ -1,51 +0,0 @@ -includeToken; - } - - - /** - * Set the value of the includeToken-property - * - * @param \SimpleSAML\WSSecurity\XML\sp\IncludeToken|string $includeToken - */ - protected function setIncludeToken(IncludeToken|string $includeToken): void - { - if (is_string($includeToken)) { - Assert::validURI($includeToken); - } - - $this->includeToken = $includeToken; - } -} diff --git a/tests/WSSecurity/XML/sp/HttpsTokenTest.php b/tests/WSSecurity/XML/sp/HttpsTokenTest.php index a5d11ddd..0160ce9c 100644 --- a/tests/WSSecurity/XML/sp/HttpsTokenTest.php +++ b/tests/WSSecurity/XML/sp/HttpsTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\HttpsTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\HttpsToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/IssuedTokenTest.php b/tests/WSSecurity/XML/sp/IssuedTokenTest.php index 2668811c..67dce486 100644 --- a/tests/WSSecurity/XML/sp/IssuedTokenTest.php +++ b/tests/WSSecurity/XML/sp/IssuedTokenTest.php @@ -24,6 +24,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\IssuedTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\IssuedToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractIssuedTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/KerberosTokenTest.php b/tests/WSSecurity/XML/sp/KerberosTokenTest.php index ccb6ef8c..918522c3 100644 --- a/tests/WSSecurity/XML/sp/KerberosTokenTest.php +++ b/tests/WSSecurity/XML/sp/KerberosTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\KerberosTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\KerberosToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/KeyValueTokenTest.php b/tests/WSSecurity/XML/sp/KeyValueTokenTest.php index cc77b209..25ae2a67 100644 --- a/tests/WSSecurity/XML/sp/KeyValueTokenTest.php +++ b/tests/WSSecurity/XML/sp/KeyValueTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\KeyValueTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\KeyValueToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractKeyValueTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/RelTokenTest.php b/tests/WSSecurity/XML/sp/RelTokenTest.php index 74eb4d3e..20621a22 100644 --- a/tests/WSSecurity/XML/sp/RelTokenTest.php +++ b/tests/WSSecurity/XML/sp/RelTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\RelTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\RelToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/RequestSecurityTokenTemplateTest.php b/tests/WSSecurity/XML/sp/RequestSecurityTokenTemplateTest.php index 04ea5c17..93dae9e3 100644 --- a/tests/WSSecurity/XML/sp/RequestSecurityTokenTemplateTest.php +++ b/tests/WSSecurity/XML/sp/RequestSecurityTokenTemplateTest.php @@ -54,7 +54,12 @@ public function testMarshalling(): void 'some' )->documentElement); - $RequestSecurityTokenTemplateElements = new RequestSecurityTokenTemplate('urn:x-simplesamlphp:version', [$chunk], [$attr]); + $RequestSecurityTokenTemplateElements = new RequestSecurityTokenTemplate( + 'urn:x-simplesamlphp:version', + [$chunk], + [$attr], + ); + $this->assertEquals( self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement), strval($RequestSecurityTokenTemplateElements), diff --git a/tests/WSSecurity/XML/sp/SamlTokenTest.php b/tests/WSSecurity/XML/sp/SamlTokenTest.php index b24529f1..6fa12d17 100644 --- a/tests/WSSecurity/XML/sp/SamlTokenTest.php +++ b/tests/WSSecurity/XML/sp/SamlTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\SamlTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\SamlToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/SecurityContextTokenTest.php b/tests/WSSecurity/XML/sp/SecurityContextTokenTest.php index e888b408..9e712be9 100644 --- a/tests/WSSecurity/XML/sp/SecurityContextTokenTest.php +++ b/tests/WSSecurity/XML/sp/SecurityContextTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\SecurityContextTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\SecurityContextToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/UsernameTokenTest.php b/tests/WSSecurity/XML/sp/UsernameTokenTest.php index 26e09ae0..19cebc73 100644 --- a/tests/WSSecurity/XML/sp/UsernameTokenTest.php +++ b/tests/WSSecurity/XML/sp/UsernameTokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\UsernameTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\UsernameToken + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement * diff --git a/tests/WSSecurity/XML/sp/X509TokenTest.php b/tests/WSSecurity/XML/sp/X509TokenTest.php index 2b88ca0d..c3e2a85a 100644 --- a/tests/WSSecurity/XML/sp/X509TokenTest.php +++ b/tests/WSSecurity/XML/sp/X509TokenTest.php @@ -22,6 +22,7 @@ * Class \SimpleSAML\WSSecurity\XML\sp\X509lTokenTest * * @covers \SimpleSAML\WSSecurity\XML\sp\X509Token + * @covers \SimpleSAML\WSSecurity\XML\sp\IncludeTokenTypeTrait * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractAssertionTokenType * @covers \SimpleSAML\WSSecurity\XML\sp\AbstractSpElement *