From 1efc99551cc320f42f627210ed678da82540156a Mon Sep 17 00:00:00 2001 From: Tim van Dijen Date: Wed, 27 Nov 2024 21:46:16 +0100 Subject: [PATCH] Add element xenc:Q --- src/XML/xenc/Q.php | 26 ++++++++++++++ tests/XML/xenc/QTest.php | 65 ++++++++++++++++++++++++++++++++++ tests/resources/xml/xenc_Q.xml | 1 + 3 files changed, 92 insertions(+) create mode 100644 src/XML/xenc/Q.php create mode 100644 tests/XML/xenc/QTest.php create mode 100644 tests/resources/xml/xenc_Q.xml diff --git a/src/XML/xenc/Q.php b/src/XML/xenc/Q.php new file mode 100644 index 00000000..379ecb54 --- /dev/null +++ b/src/XML/xenc/Q.php @@ -0,0 +1,26 @@ +setContent($content); + } +} diff --git a/tests/XML/xenc/QTest.php b/tests/XML/xenc/QTest.php new file mode 100644 index 00000000..46ddcb12 --- /dev/null +++ b/tests/XML/xenc/QTest.php @@ -0,0 +1,65 @@ +assertEquals( + XMLDumper::dumpDOMDocumentXMLWithBase64Content(self::$xmlRepresentation), + strval($q), + ); + } + + + /** + */ + public function testMarshallingNotBase64(): void + { + $this->expectException(AssertionFailedException::class); + new Q('/CTj3d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI='); + } +} diff --git a/tests/resources/xml/xenc_Q.xml b/tests/resources/xml/xenc_Q.xml new file mode 100644 index 00000000..421da4f6 --- /dev/null +++ b/tests/resources/xml/xenc_Q.xml @@ -0,0 +1 @@ +/CTj03d1DB5e2t7CTo9BEzCf5S9NRzwnBgZRlm32REI=