Skip to content

Commit 567c67c

Browse files
committed
Add more thorough test to TransformTest
1 parent 8c66846 commit 567c67c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

tests/XML/ds/TransformTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use SimpleSAML\XML\DOMDocumentFactory;
1111
use SimpleSAML\XMLSecurity\XML\ds\Transform;
1212
use SimpleSAML\XMLSecurity\XML\ds\XPath;
13+
use SimpleSAML\XMLSecurity\XML\ec\InclusiveNamespaces;
1314

1415
/**
1516
* Class \SimpleSAML\XMLSecurity\Test\XML\ds\TransformTest
@@ -49,6 +50,25 @@ public function testMarshalling(): void
4950
$this->xmlRepresentation->saveXML($this->xmlRepresentation->documentElement),
5051
strval($transform)
5152
);
53+
54+
$transform = new Transform(
55+
C::C14N_EXCLUSIVE_WITHOUT_COMMENTS,
56+
null,
57+
new InclusiveNamespaces(["dsig", "soap", "#default"])
58+
);
59+
60+
61+
$this->assertInstanceOf(InclusiveNamespaces::class, $transform->getInclusiveNamespaces());
62+
$this->assertNull($transform->getXPath());
63+
64+
$xmlRepresentation = DOMDocumentFactory::fromFile(
65+
dirname(dirname(dirname(__FILE__))) .
66+
'/resources/xml/ds_Transform_InclusiveNamespaces.xml'
67+
);
68+
$this->assertEquals(
69+
$xmlRepresentation->saveXML($xmlRepresentation->documentElement),
70+
strval($transform)
71+
);
5272
}
5373

5474

0 commit comments

Comments
 (0)