2424use Symfony \Component \HttpFoundation \Session \Storage \MockArraySessionStorage ;
2525
2626/**
27- * Integration test: simulates the complete 4-leg SAML authentication flow and
28- * verifies that a single correlation ID flows through every leg via
29- * CorrelationIdService.
27+ * Integration test: simulates the complete 4-leg SAML authentication flow and verifies that a single
28+ * correlation ID flows through every leg via CorrelationIdService.
3029 *
31- * Leg 1 SSO SP AuthnRequest ID = A → mint → correlation_id = CX
32- * Leg 2 ContinueToIdp ID = A (POST) → resolve(A) → CX
33- * EB AuthnRequest ID = B → link(B, A) → B also maps to CX
34- * Leg 3 ACS IdP Response InResponseTo=B → resolve(B) → CX
35- * Leg 4 Consent SP request ID = A → resolve(A) → CX
30+ * Leg 1 SSO SP AuthnRequest ID = A > mint > correlation_id = CX
31+ *
32+ * Leg 2 ContinueToIdp ID = A (POST) > resolve(A) → CX
33+ * EB AuthnRequest ID = B > link(B, A) > B also maps to CX
34+ *
35+ * Leg 3 ACS IdP Response InResponseTo=B > resolve(B) > CX
36+ * Leg 4 Consent SP request ID = A > resolve(A) > CX
3637 */
3738class CorrelationIdFlowTest extends TestCase
3839{
@@ -67,8 +68,6 @@ private function newServiceWithCurrent(CurrentCorrelationId $current): Correlati
6768 return new CorrelationIdService ($ repository , $ current );
6869 }
6970
70- // ── WAYF path ────────────────────────────────────────────────────────────
71-
7271 public function test_wayf_flow_all_four_legs_share_the_same_correlation_id (): void
7372 {
7473 $ spRequestId = '_sp-request-A ' ;
@@ -99,8 +98,6 @@ public function test_wayf_flow_all_four_legs_share_the_same_correlation_id(): vo
9998 $ this ->assertSame ($ mintedCx , $ leg4Current ->correlationId , 'Consent must see the same correlation ID ' );
10099 }
101100
102- // ── Direct path (no WAYF) ─────────────────────────────────────────────────
103-
104101 public function test_direct_flow_acs_and_consent_share_the_correlation_id_minted_at_sso (): void
105102 {
106103 $ spRequestId = '_sp-direct-A ' ;
@@ -117,8 +114,6 @@ public function test_direct_flow_acs_and_consent_share_the_correlation_id_minted
117114 $ this ->assertSame ($ mintedCx , $ ids [$ spRequestId ], 'Consent resolves via SP request ID ' );
118115 }
119116
120- // ── Concurrent flows ──────────────────────────────────────────────────────
121-
122117 public function test_two_concurrent_flows_have_independent_correlation_ids (): void
123118 {
124119 $ this ->service ->mint ('_sp-A1 ' );
@@ -138,8 +133,6 @@ public function test_two_concurrent_flows_have_independent_correlation_ids(): vo
138133 $ this ->assertSame ($ cx2 , $ ids ['_idp-B2 ' ]);
139134 }
140135
141- // ── Back-button replay guard ───────────────────────────────────────────────
142-
143136 public function test_replaying_an_sso_request_does_not_change_the_correlation_id (): void
144137 {
145138 $ spRequestId = '_sp-replay-A ' ;
@@ -152,8 +145,6 @@ public function test_replaying_an_sso_request_does_not_change_the_correlation_id
152145 $ this ->assertSame ($ cx , $ this ->session ->get ('CorrelationIds ' )[$ spRequestId ], 'Back-button replay must not change the correlation ID ' );
153146 }
154147
155- // ── Null safety ───────────────────────────────────────────────────────────
156-
157148 public function test_unknown_request_id_does_not_set_correlation_id (): void
158149 {
159150 $ this ->service ->resolve ('_unknown-id ' );
0 commit comments