Skip to content

Commit b214f7b

Browse files
committed
Use SerializableXMLTestTrait
1 parent 96452ab commit b214f7b

1 file changed

Lines changed: 3 additions & 15 deletions

File tree

tests/XML/CustomSignableTest.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
use DOMDocument;
88
use PHPUnit\Framework\TestCase;
9+
use SimpleSAML\Test\XML\SerializableXMLTestTrait;
910
use SimpleSAML\XML\DOMDocumentFactory;
1011
use SimpleSAML\XML\Chunk;
1112
use SimpleSAML\XMLSecurity\Test\XML\CustomSignable;
@@ -19,15 +20,14 @@
1920
*/
2021
final class SignableElementTest extends TestCase
2122
{
22-
/** @var \DOMDocument */
23-
private DOMDocument $document;
23+
use SerializableXMLTestTrait;
2424

2525

2626
/**
2727
*/
2828
public function setUp(): void
2929
{
30-
$this->document = DOMDocumentFactory::fromFile(
30+
$this->xmlRepresentation = DOMDocumentFactory::fromFile(
3131
dirname(dirname(__FILE__)) . '/resources/xml/custom_CustomSignable.xml'
3232
);
3333
}
@@ -64,18 +64,6 @@ public function testUnmarshalling(): void
6464
'Chunk',
6565
$customSignableElement->textContent
6666
);
67-
}
68-
69-
70-
/**
71-
* Test serialization / unserialization
72-
*/
73-
public function testSerialization(): void
74-
{
75-
$this->assertEquals(
76-
$this->document->saveXML($this->document->documentElement),
77-
strval(unserialize(serialize(CustomSignable::fromXML($this->document->documentElement))))
78-
);
7967
}
8068
}
8169

0 commit comments

Comments
 (0)