99use SimpleSAML \Assert \AssertionFailedException ;
1010use SimpleSAML \Configuration ;
1111use SimpleSAML \Error \Exception ;
12- use SimpleSAML \SAML2 \{AuthnRequest , LogoutRequest };
1312use SimpleSAML \SAML2 \Constants as C ;
1413use SimpleSAML \SAML2 \Exception \Protocol \{NoAvailableIDPException , NoSupportedIDPException };
1514use SimpleSAML \SAML2 \Utils \XPath ;
1615use SimpleSAML \SAML2 \XML \saml \AuthnContextClassRef ;
1716use SimpleSAML \SAML2 \XML \saml \NameID ;
17+ use SimpleSAML \SAML2 \XML \samlp \{AuthnRequest , LogoutRequest };
1818use SimpleSAML \SAML2 \XML \samlp \{IDPEntry , IDPList };
1919use SimpleSAML \Test \Metadata \MetaDataStorageSourceTest ;
2020use SimpleSAML \TestUtils \ClearStateTestCase ;
@@ -120,15 +120,15 @@ protected function setUp(): void
120120 * @param array $state The state array to use in the test. This is an array of the parameters described in section
121121 * 2 of https://simplesamlphp.org/docs/development/saml:sp
122122 *
123- * @return \SimpleSAML\SAML2\AuthnRequest The AuthnRequest generated.
123+ * @return \SimpleSAML\SAML2\XML\samlp\ AuthnRequest The AuthnRequest generated.
124124 */
125125 private function createAuthnRequest (array $ state = []): AuthnRequest
126126 {
127127 $ info = ['AuthId ' => 'default-sp ' ];
128128 $ config = ['entityID ' => 'urn:x-simplesamlphp:example-sp ' ];
129129 $ as = new SpTester ($ info , $ config );
130130
131- /** @var \SimpleSAML\SAML2\AuthnRequest $ar */
131+ /** @var \SimpleSAML\SAML2\XML\samlp\ AuthnRequest $ar */
132132 $ ar = null ;
133133 try {
134134 $ as ->startSSO2Test ($ this ->getIdpMetadata (), $ state );
@@ -147,15 +147,15 @@ private function createAuthnRequest(array $state = []): AuthnRequest
147147 * @param array $state The state array to use in the test. This is an array of the parameters described in section
148148 * 2 of https://simplesamlphp.org/docs/development/saml:sp
149149 *
150- * @return \SimpleSAML\SAML2\LogoutRequest The LogoutRequest generated.
150+ * @return \SimpleSAML\SAML2\XML\samlp\ LogoutRequest The LogoutRequest generated.
151151 */
152152 private function createLogoutRequest (array $ state = []): LogoutRequest
153153 {
154154 $ info = ['AuthId ' => 'default-sp ' ];
155155 $ config = ['entityID ' => 'urn:x-simplesamlphp:example-sp ' ];
156156 $ as = new SpTester ($ info , $ config );
157157
158- /** @var \SimpleSAML\SAML2\LogoutRequest $lr */
158+ /** @var \SimpleSAML\SAML2\XML\samlp\ LogoutRequest $lr */
159159 $ lr = null ;
160160 try {
161161 $ as ->startSLO2 ($ this ->config , $ state );
@@ -176,7 +176,7 @@ public function testAuthnRequest(): void
176176 {
177177 $ ar = $ this ->createAuthnRequest ();
178178
179- $ xml = $ ar ->toSignedXML ();
179+ $ xml = $ ar ->toXML ();
180180
181181 $ xpCache = XPath::getXPath ($ xml );
182182 /** @var \DOMAttr[] $q */
@@ -207,11 +207,11 @@ public function testNameID(): void
207207 $ ar = $ this ->createAuthnRequest ($ state );
208208
209209 /** @var \SimpleSAML\SAML2\XML\saml\NameID $nameID */
210- $ nameID = $ ar ->getNameId ();
210+ $ nameID = $ ar ->getSubject ()?->getIdentifier ();
211211 $ this ->assertEquals ($ state ['saml:NameID ' ]['value ' ], $ nameID ->getContent ());
212212 $ this ->assertEquals ($ state ['saml:NameID ' ]['Format ' ], $ nameID ->getFormat ());
213213
214- $ xml = $ ar ->toSignedXML ();
214+ $ xml = $ ar ->toXML ();
215215
216216 $ xpCache = XPath::getXPath ($ xml );
217217 /** @var \DOMAttr[] $q */
@@ -247,7 +247,7 @@ public function testAuthnContextClassRef(): void
247247 $ a ->getRequestedAuthnContexts ()[0 ]->getContent (),
248248 );
249249
250- $ xml = $ ar ->toSignedXML ();
250+ $ xml = $ ar ->toXML ();
251251
252252 $ xpCache = XPath::getXPath ($ xml );
253253 $ q = XPath::xpQuery (
@@ -280,7 +280,7 @@ public function testForcedAuthn(): void
280280 $ ar ->getForceAuthn ()
281281 );
282282
283- $ xml = $ ar ->toSignedXML ();
283+ $ xml = $ ar ->toXML ();
284284
285285 $ xpCache = XPath::getXPath ($ xml );
286286 /** @var \DOMAttr[] $q */
@@ -371,9 +371,9 @@ public function testIdpListWithExplicitIdpMatch(): void
371371 $ this ->fail ('Expected ExitTestException ' );
372372 } catch (ExitTestException $ e ) {
373373 $ r = $ e ->getTestResult ();
374- /** @var AuthnRequest $ar */
374+ /** @var \SimpleSAML\SAML2\XML\samlp\ AuthnRequest $ar */
375375 $ ar = $ r ['ar ' ];
376- $ xml = $ ar ->toSignedXML ();
376+ $ xml = $ ar ->toXML ();
377377
378378 $ xpCache = XPath::getXPath ($ xml );
379379 /** @var \DOMAttr[] $q */
@@ -412,9 +412,9 @@ public function testIdpListWithSingleMatch(): void
412412 $ this ->fail ('Expected ExitTestException ' );
413413 } catch (ExitTestException $ e ) {
414414 $ r = $ e ->getTestResult ();
415- /** @var AuthnRequest $ar */
415+ /** @var \SimpleSAML\SAML2\XML\samlp\ AuthnRequest $ar */
416416 $ ar = $ r ['ar ' ];
417- $ xml = $ ar ->toSignedXML ();
417+ $ xml = $ ar ->toXML ();
418418
419419 $ xpCache = XPath::getXPath ($ xml );
420420 /** @var \DOMAttr[] $q */
@@ -535,7 +535,7 @@ public function testRemoteMetadataScoping(): void
535535 ];
536536 $ as = new SpTester ($ info , $ config );
537537
538- /** @var \SimpleSAML\SAML2\AuthnRequest $ar */
538+ /** @var \SimpleSAML\SAML2\XML\samlp\ AuthnRequest $ar */
539539 try {
540540 $ as ->startSSO2Test ($ this ->getIdpMetadata (), []);
541541 $ this ->assertTrue (false , 'Expected ExitTestException ' );
@@ -576,7 +576,7 @@ public function testSPIdpListScopingOrder(
576576
577577 $ as = new SpTester ($ info , $ config );
578578
579- /** @var \SimpleSAML\SAML2\AuthnRequest $ar */
579+ /** @var \SimpleSAML\SAML2\XML\samlp\ AuthnRequest $ar */
580580 try {
581581 $ as ->startSSO2Test ($ this ->getIdpMetadata (), $ state );
582582 $ this ->assertTrue (false , 'Expected ExitTestException ' );
@@ -1541,7 +1541,7 @@ public function testLogoutRequest(): void
15411541 $ extensions = $ lr ->getExtensions ();
15421542 $ this ->assertcount (1 , $ state ['saml:logout:Extensions ' ]);
15431543
1544- $ xml = $ lr ->toSignedXML ();
1544+ $ xml = $ lr ->toXML ();
15451545
15461546 $ xpCache = XPath::getXPath ($ xml );
15471547 $ q = XPath::xpQuery ($ xml , '/samlp:LogoutRequest/saml:NameID ' , $ xpCache );
0 commit comments