@@ -332,11 +332,17 @@ public function testPasswordlessLoginNoLastCheckUpdate(): void {
332332 ->getMock ();
333333 $ userSession = new Session ($ manager , $ session , $ this ->timeFactory , $ this ->tokenProvider , $ this ->config , $ this ->random , $ this ->lockdownManager , $ this ->logger , $ this ->dispatcher );
334334
335- $ session ->expects ($ this ->never ())
336- ->method ('set ' );
335+ $ user = $ this ->createMock (IUser::class);
336+ $ user ->method ('getUID ' )->willReturn ('foo ' );
337+ $ user ->method ('isEnabled ' )->willReturn (true );
338+ $ manager ->method ('get ' )
339+ ->with ('foo ' )
340+ ->willReturn ($ user );
341+
337342 $ session ->expects ($ this ->once ())
338343 ->method ('regenerateId ' );
339344 $ token = new PublicKeyToken ();
345+ $ token ->setId (1 );
340346 $ token ->setLoginName ('foo ' );
341347 $ token ->setLastCheck (0 ); // Never
342348 $ token ->setUid ('foo ' );
@@ -370,11 +376,17 @@ public function testLoginLastCheckUpdate(): void {
370376 ->getMock ();
371377 $ userSession = new Session ($ manager , $ session , $ this ->timeFactory , $ this ->tokenProvider , $ this ->config , $ this ->random , $ this ->lockdownManager , $ this ->logger , $ this ->dispatcher );
372378
373- $ session ->expects ($ this ->never ())
374- ->method ('set ' );
379+ $ user = $ this ->createMock (IUser::class);
380+ $ user ->method ('getUID ' )->willReturn ('foo ' );
381+ $ user ->method ('isEnabled ' )->willReturn (true );
382+ $ manager ->method ('get ' )
383+ ->with ('foo ' )
384+ ->willReturn ($ user );
385+
375386 $ session ->expects ($ this ->once ())
376387 ->method ('regenerateId ' );
377388 $ token = new PublicKeyToken ();
389+ $ token ->setId (1 );
378390 $ token ->setLoginName ('foo ' );
379391 $ token ->setLastCheck (0 ); // Never
380392 $ token ->setUid ('foo ' );
@@ -1325,4 +1337,5 @@ public function testLogClientInThrottlerEmail(): void {
13251337
13261338 $ this ->assertFalse ($ userSession ->logClientIn ('john@foo.bar ' , 'I-AM-A-PASSWORD ' , $ request , $ this ->throttler ));
13271339 }
1340+
13281341}
0 commit comments