Skip to content
This repository was archived by the owner on Jan 21, 2026. It is now read-only.

Commit b69be1c

Browse files
committed
Replace attribute-creation with MustUnderstandValue from soap-lib
1 parent 84f42ff commit b69be1c

47 files changed

Lines changed: 191 additions & 220 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/WSSecurity/XML/wsa_200508/MessageIDTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as C;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractAttributedURIType;
1212
use SimpleSAML\WSSecurity\XML\wsa_200508\AbstractWsaElement;
1313
use SimpleSAML\WSSecurity\XML\wsa_200508\MessageID;
@@ -54,8 +54,8 @@ public static function setUpBeforeClass(): void
5454
*/
5555
public function testMarshalling(): void
5656
{
57-
$attr1 = new Attribute(C::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
58-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
57+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
58+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
5959

6060
$this->assertEquals(
6161
self::$xmlRepresentation->saveXML(self::$xmlRepresentation->documentElement),

tests/WSSecurity/XML/wst_200502/AuthenticatorTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractAuthenticatorType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\Authenticator;
1515
use SimpleSAML\WSSecurity\XML\wst_200502\CombinedHash;
16-
use SimpleSAML\XML\Attribute as XMLAttribute;
1716
use SimpleSAML\XML\DOMDocumentFactory;
1817
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1918
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -57,8 +56,8 @@ public static function setUpBeforeClass(): void
5756
*/
5857
public function testMarshalling(): void
5958
{
60-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
61-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
59+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
60+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6261

6362
$combinedHash = new CombinedHash('/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=');
6463
$authenticator = new Authenticator($combinedHash, [$msgId]);

tests/WSSecurity/XML/wst_200502/CancelTargetTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractCancelTargetType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\CancelTarget;
15-
use SimpleSAML\XML\Attribute as XMLAttribute;
1615
use SimpleSAML\XML\DOMDocumentFactory;
1716
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1817
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void
5655
*/
5756
public function testMarshalling(): void
5857
{
59-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
60-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
58+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
59+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6160

6261
$cancelTarget = new CancelTarget($msgId);
6362

tests/WSSecurity/XML/wst_200502/ClaimsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\Test\WSSecurity\Constants as C;
1212
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractClaimsType;
@@ -57,10 +57,10 @@ public static function setUpBeforeClass(): void
5757
*/
5858
public function testMarshalling(): void
5959
{
60-
$attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
61-
$attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
62-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]);
60+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
61+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6362

63+
$attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
6464
$claims = new Claims(C::NAMESPACE, [$msgId], [$attr1]);
6565

6666
$this->assertEquals(

tests/WSSecurity/XML/wst_200502/DelegateToTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractDelegateToType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\DelegateTo;
15-
use SimpleSAML\XML\Attribute as XMLAttribute;
1615
use SimpleSAML\XML\DOMDocumentFactory;
1716
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1817
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void
5655
*/
5756
public function testMarshalling(): void
5857
{
59-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
60-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
58+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
59+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6160

6261
$delegateTo = new DelegateTo($msgId);
6362

tests/WSSecurity/XML/wst_200502/EncryptionTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractEncryptionType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\Encryption;
15-
use SimpleSAML\XML\Attribute as XMLAttribute;
1615
use SimpleSAML\XML\DOMDocumentFactory;
1716
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1817
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void
5655
*/
5756
public function testMarshalling(): void
5857
{
59-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
60-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
58+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
59+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6160

6261
$encryption = new Encryption($msgId);
6362

tests/WSSecurity/XML/wst_200502/EntropyTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\Test\WSSecurity\Constants as C;
1212
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractEntropyType;
@@ -57,10 +57,10 @@ public static function setUpBeforeClass(): void
5757
*/
5858
public function testMarshalling(): void
5959
{
60-
$attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
61-
$attr2 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
62-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr2]);
60+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
61+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6362

63+
$attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
6464
$entropy = new Entropy([$msgId], [$attr1]);
6565

6666
$this->assertEquals(

tests/WSSecurity/XML/wst_200502/IssuedTokensTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\Test\WSSecurity\Constants as C;
1212
use SimpleSAML\WSSecurity\XML\wsa_200408\AbstractEndpointReferenceType;
1313
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
@@ -58,16 +58,16 @@ public static function setUpBeforeClass(): void
5858
*/
5959
public function testMarshalling(): void
6060
{
61-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
62-
$attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
63-
$attr3 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2');
64-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
61+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
62+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6563

66-
$requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr2]);
64+
$attr1 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr1', 'testval1');
65+
$attr2 = new XMLAttribute(C::NAMESPACE, 'ssp', 'attr2', 'testval2');
66+
$requestSecurityTokenResponse = new RequestSecurityTokenResponse(C::NAMESPACE, [$msgId], [$attr1]);
6767

6868
$issuedTokens = new IssuedTokens(
6969
[$requestSecurityTokenResponse],
70-
[$attr3],
70+
[$attr2],
7171
);
7272

7373
$this->assertEquals(

tests/WSSecurity/XML/wst_200502/KeyExchangeTokenTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractKeyExchangeTokenType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\KeyExchangeToken;
15-
use SimpleSAML\XML\Attribute as XMLAttribute;
1615
use SimpleSAML\XML\DOMDocumentFactory;
1716
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1817
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void
5655
*/
5756
public function testMarshalling(): void
5857
{
59-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
60-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
58+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
59+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6160

6261
$keyExchangeToken = new KeyExchangeToken([$msgId]);
6362

tests/WSSecurity/XML/wst_200502/OnBehalfOfTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@
77
use PHPUnit\Framework\Attributes\CoversClass;
88
use PHPUnit\Framework\Attributes\Group;
99
use PHPUnit\Framework\TestCase;
10-
use SimpleSAML\SOAP\Constants as SOAP;
10+
use SimpleSAML\SOAP11\Type\MustUnderstandValue;
1111
use SimpleSAML\WSSecurity\XML\wsa_200408\MessageID;
1212
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractOnBehalfOfType;
1313
use SimpleSAML\WSSecurity\XML\wst_200502\AbstractWstElement;
1414
use SimpleSAML\WSSecurity\XML\wst_200502\OnBehalfOf;
15-
use SimpleSAML\XML\Attribute as XMLAttribute;
1615
use SimpleSAML\XML\DOMDocumentFactory;
1716
use SimpleSAML\XML\TestUtils\SchemaValidationTestTrait;
1817
use SimpleSAML\XML\TestUtils\SerializableElementTestTrait;
@@ -56,8 +55,8 @@ public static function setUpBeforeClass(): void
5655
*/
5756
public function testMarshalling(): void
5857
{
59-
$attr1 = new XMLAttribute(SOAP::NS_SOAP_ENV_11, 'soapenv', 'mustUnderstand', '1');
60-
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$attr1]);
58+
$mustUnderstand = MustUnderstandValue::fromBoolean(true);
59+
$msgId = new MessageID('uuid:d0ccf3cd-2dce-4c1a-a5d6-be8912ecd7de', [$mustUnderstand->toAttribute()]);
6160

6261
$onBehalfOf = new OnBehalfOf($msgId);
6362

0 commit comments

Comments
 (0)