@@ -378,9 +378,86 @@ public function testCanGetProtocolDiscoveryShowClaimsSupported(): void
378378 $ this ->assertFalse ($ this ->sut ()->getProtocolDiscoveryShowClaimsSupported ());
379379 $ this ->assertTrue (
380380 $ this ->sut (
381- null ,
382- [ModuleConfig::OPTION_PROTOCOL_DISCOVERY_SHOW_CLAIMS_SUPPORTED => true ],
381+ overrides: [ModuleConfig::OPTION_PROTOCOL_DISCOVERY_SHOW_CLAIMS_SUPPORTED => true ],
383382 )->getProtocolDiscoveryShowClaimsSupported (),
384383 );
385384 }
385+
386+ public function testCanGetProtocolNewCertPath (): void
387+ {
388+ $ this ->assertNull ($ this ->sut ()->getProtocolNewCertPath ());
389+
390+ $ sut = $ this ->sut (
391+ overrides: [ModuleConfig::OPTION_PKI_NEW_CERTIFICATE_FILENAME => 'new-cert ' ],
392+ );
393+
394+ $ this ->assertStringContainsString ('new-cert ' , $ sut ->getProtocolNewCertPath ());
395+ }
396+
397+ public function testCanGetFederationNewCertPath (): void
398+ {
399+ $ this ->assertNull ($ this ->sut ()->getFederationNewCertPath ());
400+
401+ $ sut = $ this ->sut (
402+ overrides: [ModuleConfig::OPTION_PKI_FEDERATION_NEW_CERTIFICATE_FILENAME => 'new-cert ' ],
403+ );
404+
405+ $ this ->assertStringContainsString ('new-cert ' , $ sut ->getFederationNewCertPath ());
406+ }
407+
408+ public function testCanGetFederationDynamicTrustMarks (): void
409+ {
410+ $ this ->assertNull ($ this ->sut ()->getFederationDynamicTrustMarks ());
411+
412+ $ sut = $ this ->sut (
413+ overrides: [
414+ ModuleConfig::OPTION_FEDERATION_DYNAMIC_TRUST_MARKS => [
415+ 'trust-mark-id ' => 'trust-mark-issuer-id ' ,
416+ ],
417+ ],
418+ );
419+
420+ $ this ->assertArrayHasKey (
421+ 'trust-mark-id ' ,
422+ $ sut ->getFederationDynamicTrustMarks (),
423+ );
424+ }
425+
426+ public function testCanGetFederationParticipationLimitByTrustMarks (): void
427+ {
428+ $ this ->assertArrayHasKey (
429+ 'https://ta.example.org/ ' ,
430+ $ this ->sut ()->getFederationParticipationLimitByTrustMarks (),
431+ );
432+ }
433+
434+ public function testCanGetTrustMarksNeededForFederationParticipationFor (): void
435+ {
436+ $ neededTrustMarks = $ this ->sut ()->getTrustMarksNeededForFederationParticipationFor ('https://ta.example.org/ ' );
437+
438+ $ this ->assertArrayHasKey ('one_of ' , $ neededTrustMarks );
439+ $ this ->assertTrue (in_array ('trust-mark-id ' , $ neededTrustMarks ['one_of ' ]));
440+ }
441+
442+ public function testGetTrustMarksNeededForFederationParticipationForThrowsOnInvalidConfigValue (): void
443+ {
444+ $ sut = $ this ->sut (
445+ overrides: [
446+ ModuleConfig::OPTION_FEDERATION_PARTICIPATION_LIMIT_BY_TRUST_MARKS => [
447+ 'https://ta.example.org/ ' => 'invalid ' ,
448+ ],
449+ ],
450+ );
451+
452+ $ this ->expectException (ConfigurationError::class);
453+
454+ $ sut ->getTrustMarksNeededForFederationParticipationFor ('https://ta.example.org/ ' );
455+ }
456+
457+ public function testCanGetIsFederationParticipationLimitedByTrustMarksFor (): void
458+ {
459+ $ this ->assertTrue (
460+ $ this ->sut ()->isFederationParticipationLimitedByTrustMarksFor ('https://ta.example.org/ ' ),
461+ );
462+ }
386463}
0 commit comments