@@ -140,6 +140,36 @@ public function testBeforeControllerNoPasswordAvailable() {
140140 );
141141 }
142142
143+ public function testBeforeControllerPasswordlessSignin () {
144+ $ user = $ this ->createConfiguredMock (IUser::class, [
145+ 'getEmailAddress ' => 'bruce.wayne@batman.com '
146+ ]);
147+ $ this ->userSession ->expects ($ this ->once ())
148+ ->method ('getUser ' )
149+ ->willReturn ($ user );
150+ $ configs = [new Provisioning ()];
151+ $ this ->provisioningManager ->expects ($ this ->once ())
152+ ->method ('getConfigs ' )
153+ ->willReturn ($ configs );
154+ $ this ->provisioningManager ->expects ($ this ->once ())
155+ ->method ('provisionSingleUser ' )
156+ ->with ($ configs , $ user );
157+ $ credentials = $ this ->createMock (ICredentials::class);
158+ $ this ->credentialStore ->expects ($ this ->once ())
159+ ->method ('getLoginCredentials ' )
160+ ->willReturn ($ credentials );
161+ $ credentials ->expects ($ this ->once ())
162+ ->method ('getPassword ' )
163+ ->willReturn (null );
164+ $ this ->provisioningManager ->expects ($ this ->never ())
165+ ->method ('updatePassword ' );
166+
167+ $ this ->middleware ->beforeController (
168+ $ this ->createMock (PageController::class),
169+ 'index '
170+ );
171+ }
172+
143173 public function testBeforeControllerNoConfigAvailable () {
144174 $ user = $ this ->createConfiguredMock (IUser::class, [
145175 'getEmailAddress ' => 'bruce.wayne@batman.com '
0 commit comments