1414use SimpleSAML \SAML2 \Exception \Protocol \{NoAvailableIDPException , NoSupportedIDPException };
1515use SimpleSAML \SAML2 \Utils \XPath ;
1616use SimpleSAML \SAML2 \XML \saml \NameID ;
17+ use SimpleSAML \SAML2 \XML \samlp \{IDPEntry , IDPList };
1718use SimpleSAML \Test \Metadata \MetaDataStorageSourceTest ;
1819use SimpleSAML \TestUtils \ClearStateTestCase ;
1920use SimpleSAML \Test \Utils \{ExitTestException , SpTester };
@@ -497,12 +498,12 @@ public function testMetadataHostedBasicConfig(): void
497498 public function testSPIdpListScoping (): void
498499 {
499500 $ ar = $ this ->createAuthnRequest ([
500- 'IDPList ' => [ 'https://scope.example.com ' ]
501+ 'IDPList ' => new IDPList ([ new IDPEntry ( 'https://scope.example.com ' )]),
501502 ]);
502503
503504 $ this ->assertContains (
504- 'https://scope.example.com ' ,
505- $ ar ->getIDPList ()
505+ ( new IDPEntry ( 'https://scope.example.com ' ))-> toArray () ,
506+ ( $ ar ->getScoping ()-> getIDPList ()-> toArray ())[ ' IDPEntry ' ],
506507 );
507508 }
508509
@@ -516,8 +517,8 @@ public function testIdpMetadataScoping(): void
516517 $ ar = $ this ->createAuthnRequest ([]);
517518
518519 $ this ->assertContains (
519- 'https://scope.example.com ' ,
520- $ ar ->getIDPList ()
520+ ( new IDPEntry ( 'https://scope.example.com ' ))-> toArray () ,
521+ ( $ ar ->getScoping ()-> getIDPList ()-> toArray ())[ ' IDPEntry ' ],
521522 );
522523 }
523524
@@ -541,8 +542,8 @@ public function testRemoteMetadataScoping(): void
541542 } catch (ExitTestException $ e ) {
542543 ['ar ' => $ ar ] = $ e ->getTestResult ();
543544 $ this ->assertContains (
544- 'https://scope.example.com ' ,
545- $ ar ->getIDPList ()
545+ ( new IDPEntry ( 'https://scope.example.com ' ))-> toArray () ,
546+ ( $ ar ->getScoping ()-> getIDPList ()-> toArray ())[ ' IDPEntry ' ],
546547 );
547548 }
548549 }
@@ -555,7 +556,7 @@ public function testRemoteMetadataScoping(): void
555556 * @dataProvider getScopingOrders
556557 */
557558 public function testSPIdpListScopingOrder (
558- ?array $ stateIdpList ,
559+ ?IDPList $ stateIdpList ,
559560 ?array $ idpConfigArray ,
560561 ?array $ remoteMetadata ,
561562 string $ expectedScope
@@ -583,8 +584,8 @@ public function testSPIdpListScopingOrder(
583584 ['ar ' => $ ar ] = $ e ->getTestResult ();
584585
585586 $ this ->assertContains (
586- $ expectedScope ,
587- $ ar ->getIDPList ()
587+ ( new IDPEntry ( $ expectedScope))-> toArray () ,
588+ ( $ ar ->getScoping ()-> getIDPList ()-> toArray ())[ ' IDPEntry ' ],
588589 );
589590 }
590591 }
@@ -593,34 +594,34 @@ public function getScopingOrders(): array
593594 {
594595 return [
595596 [
596- 'stateIdpList ' => [ 'https//scope1.example.com ' ] ,
597- 'idpConfigArray ' => ['https//scope2.example.com ' ],
598- 'remoteMetadata ' => ['https//scope3.example.com ' ],
599- 'expectedScope ' => 'https//scope1.example.com '
597+ 'stateIdpList ' => new IDPList ([ new IDPEntry ( 'https: //scope1.example.com ' )]) ,
598+ 'idpConfigArray ' => ['https: //scope2.example.com ' ],
599+ 'remoteMetadata ' => ['https: //scope3.example.com ' ],
600+ 'expectedScope ' => 'https: //scope1.example.com '
600601 ],
601602 [
602603 'stateIdpList ' => null ,
603- 'idpConfigArray ' => ['https//scope2.example.com ' ],
604- 'remoteMetadata ' => ['https//scope3.example.com ' ],
605- 'expectedScope ' => 'https//scope3.example.com '
604+ 'idpConfigArray ' => ['https: //scope2.example.com ' ],
605+ 'remoteMetadata ' => ['https: //scope3.example.com ' ],
606+ 'expectedScope ' => 'https: //scope3.example.com '
606607 ],
607608 [
608609 'stateIdpList ' => null ,
609610 'idpConfigArray ' => null ,
610- 'remoteMetadata ' => ['https//scope3.example.com ' ],
611- 'expectedScope ' => 'https//scope3.example.com '
611+ 'remoteMetadata ' => ['https: //scope3.example.com ' ],
612+ 'expectedScope ' => 'https: //scope3.example.com '
612613 ],
613614 [
614- 'stateIdpList ' => [ 'https//scope1.example.com ' ] ,
615+ 'stateIdpList ' => new IDPList ([ new IDPEntry ( 'https: //scope1.example.com ' )]) ,
615616 'idpConfigArray ' => null ,
616- 'remoteMetadata ' => ['https//scope3.example.com ' ],
617- 'expectedScope ' => 'https//scope1.example.com '
617+ 'remoteMetadata ' => ['https: //scope3.example.com ' ],
618+ 'expectedScope ' => 'https: //scope1.example.com '
618619 ],
619620 [
620- 'stateIdpList ' => [ 'https//scope1.example.com ' ] ,
621- 'idpConfigArray ' => ['https//scope2.example.com ' ],
621+ 'stateIdpList ' => new IDPList ([ new IDPEntry ( 'https: //scope1.example.com ' )]) ,
622+ 'idpConfigArray ' => ['https: //scope2.example.com ' ],
622623 'remoteMetadata ' => null ,
623- 'expectedScope ' => 'https//scope1.example.com '
624+ 'expectedScope ' => 'https: //scope1.example.com '
624625 ]
625626 ];
626627 }
0 commit comments