File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -156,6 +156,27 @@ public function testLoginRedirectsWithCorrectQueryString() {
156156 $ sut ->login ($ token );
157157 }
158158
159+ public function testLoginDoesNothingWhenAlreadyLoggedIn () {
160+ $ sessionData = self ::createMock (SessionData::class);
161+ $ _SESSION = [
162+ Authenticator::SESSION_KEY => $ sessionData ,
163+ ];
164+
165+ $ redirectHandler = self ::createMock (RedirectHandler::class);
166+ $ redirectHandler ->expects (self ::never ())
167+ ->method ("redirect " );
168+
169+ $ sut = new Authenticator (
170+ "test-key " ,
171+ "/ " ,
172+ AuthUri::DEFAULT_BASE_URI ,
173+ null ,
174+ $ redirectHandler
175+ );
176+
177+ $ sut ->login ();
178+ }
179+
159180 public function testGetUuidThrowsExceptionWhenNotLoggedIn () {
160181 $ _SESSION = [];
161182 $ sut = new Authenticator (
You can’t perform that action at this time.
0 commit comments