@@ -91,7 +91,7 @@ public function redirects_to_auth($path) {
9191 $ this ->authenticate ($ fixture , $ path , $ session ),
9292 $ session
9393 );
94- Assert::equals (' http://localhost ' .$ path , current ($ session ->value (self ::SNS )['flow ' ]));
94+ Assert::equals ([ ' uri ' => ' http://localhost ' .$ path, ' seed ' => []] , current ($ session ->value (self ::SNS )['flow ' ]));
9595 }
9696
9797 #[Test, Values(from: 'paths ' )]
@@ -105,7 +105,7 @@ public function redirects_to_auth_with_relative_callback($path) {
105105 $ this ->authenticate ($ fixture , $ path , $ session ),
106106 $ session
107107 );
108- Assert::equals (' http://localhost ' .$ path , current ($ session ->value (self ::SNS )['flow ' ]));
108+ Assert::equals ([ ' uri ' => ' http://localhost ' .$ path, ' seed ' => []] , current ($ session ->value (self ::SNS )['flow ' ]));
109109 }
110110
111111 #[Test, Values(from: 'paths ' )]
@@ -119,7 +119,7 @@ public function redirects_to_auth_using_request($path) {
119119 $ this ->authenticate ($ fixture ->target (new UseRequest ()), $ path , $ session ),
120120 $ session
121121 );
122- Assert::equals (' http://localhost ' .$ path , current ($ session ->value (self ::SNS )['flow ' ]));
122+ Assert::equals ([ ' uri ' => ' http://localhost ' .$ path, ' seed ' => []] , current ($ session ->value (self ::SNS )['flow ' ]));
123123 }
124124
125125 #[Test, Values(from: 'paths ' )]
@@ -133,7 +133,7 @@ public function redirects_to_auth_using_url($path) {
133133 $ this ->authenticate ($ fixture ->target (new UseURL (self ::SERVICE )), $ path , $ session ),
134134 $ session
135135 );
136- Assert::equals (self ::SERVICE .$ path , current ($ session ->value (self ::SNS )['flow ' ]));
136+ Assert::equals ([ ' uri ' => self ::SERVICE .$ path, ' seed ' => []] , current ($ session ->value (self ::SNS )['flow ' ]));
137137 }
138138
139139 #[Test, Values(from: 'fragments ' )]
@@ -147,7 +147,7 @@ public function redirects_to_sso_with_fragment($fragment) {
147147 $ this ->authenticate ($ fixture , '/# ' .$ fragment , $ session ),
148148 $ session
149149 );
150- Assert::equals (' http://localhost/# ' .$ fragment , current ($ session ->value (self ::SNS )['flow ' ]));
150+ Assert::equals ([ ' uri ' => ' http://localhost/# ' .$ fragment, ' seed ' => []] , current ($ session ->value (self ::SNS )['flow ' ]));
151151 }
152152
153153 #[Test, Values([[['user ' ]], [['user ' , 'openid ' ]]])]
@@ -196,7 +196,7 @@ public function passes_client_id_and_secret() {
196196 ]);
197197 $ fixture = new OAuth2Flow (self ::AUTH , $ tokens , $ credentials , self ::CALLBACK );
198198 $ session = (new ForTesting ())->create ();
199- $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => self ::SERVICE ]]);
199+ $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => [ ' uri ' => self ::SERVICE , ' seed ' => []] ]]);
200200
201201 $ this ->authenticate ($ fixture , '/?code=SERVER_CODE&state= ' .$ state , $ session );
202202 Assert::equals ('authorization_code ' , $ passed ['grant_type ' ]);
@@ -214,7 +214,7 @@ public function passes_client_id_assertion_and_rs256_jwt() {
214214 ]);
215215 $ fixture = new OAuth2Flow (self ::AUTH , $ tokens , $ credentials , self ::CALLBACK );
216216 $ session = (new ForTesting ())->create ();
217- $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => self ::SERVICE ]]);
217+ $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => [ ' uri ' => self ::SERVICE , ' seed ' => []] ]]);
218218
219219 $ this ->authenticate ($ fixture , '/?code=SERVER_CODE&state= ' .$ state , $ session );
220220 Assert::equals ('authorization_code ' , $ passed ['grant_type ' ]);
@@ -233,7 +233,7 @@ public function gets_access_token_and_redirects_to_self() {
233233 ]);
234234 $ fixture = new OAuth2Flow (self ::AUTH , $ tokens , self ::CONSUMER , self ::CALLBACK );
235235 $ session = (new ForTesting ())->create ();
236- $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => self ::SERVICE ]]);
236+ $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => [ ' uri ' => self ::SERVICE , ' seed ' => []] ]]);
237237
238238 $ res = $ this ->authenticate ($ fixture , '/?code=SERVER_CODE&state= ' .$ state , $ session );
239239 Assert::equals (self ::SERVICE , $ res ->headers ()['Location ' ]);
@@ -266,7 +266,7 @@ public function gets_access_token_and_redirects_to_self_with_fragment($fragment)
266266 ]);
267267 $ fixture = new OAuth2Flow (self ::AUTH , $ tokens , self ::CONSUMER , self ::CALLBACK );
268268 $ session = (new ForTesting ())->create ();
269- $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => self ::SERVICE ]]);
269+ $ session ->register ('oauth2::flow ' , ['flow ' => [$ state => [ ' uri ' => self ::SERVICE , ' seed ' => []] ]]);
270270
271271 $ res = $ this ->authenticate ($ fixture , '/?code=SERVER_CODE&state= ' .$ state .OAuth2Flow::FRAGMENT .urlencode ($ fragment ), $ session );
272272 Assert::equals (self ::SERVICE .'# ' .$ fragment , $ res ->headers ()['Location ' ]);
@@ -277,7 +277,7 @@ public function gets_access_token_and_redirects_to_self_with_fragment($fragment)
277277 public function raises_exception_on_state_mismatch () {
278278 $ fixture = new OAuth2Flow (self ::AUTH , self ::TOKENS , self ::CONSUMER , self ::CALLBACK );
279279 $ session = (new ForTesting ())->create ();
280- $ session ->register ('oauth2::flow ' , ['flow ' => ['CLIENTSTATE ' => self ::SERVICE ]]);
280+ $ session ->register ('oauth2::flow ' , ['flow ' => ['CLIENTSTATE ' => [ ' uri ' => self ::SERVICE , ' seed ' => []] ]]);
281281
282282 $ this ->authenticate ($ fixture , '/?state=SERVERSTATE&code=SERVER_CODE ' , $ session );
283283 }
@@ -414,7 +414,10 @@ public function parallel_requests_stored() {
414414 $ this ->authenticate ($ fixture , '/favicon.ico ' , $ session );
415415
416416 Assert::equals (
417- ['http://localhost/new ' , 'http://localhost/favicon.ico ' ],
417+ [
418+ ['uri ' => 'http://localhost/new ' , 'seed ' => []],
419+ ['uri ' => 'http://localhost/favicon.ico ' , 'seed ' => []],
420+ ],
418421 array_values ($ session ->value (self ::SNS )['flow ' ])
419422 );
420423 }
0 commit comments