@@ -114,7 +114,7 @@ public function isLoggedInData() {
114114 * @dataProvider isLoggedInData
115115 */
116116 public function testIsLoggedIn ($ isLoggedIn ) {
117- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
117+ $ session = $ this ->createMock (Memory::class);
118118
119119 $ manager = $ this ->createMock (Manager::class);
120120
@@ -132,7 +132,7 @@ public function testIsLoggedIn($isLoggedIn) {
132132 }
133133
134134 public function testSetUser () {
135- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
135+ $ session = $ this ->createMock (Memory::class);
136136 $ session ->expects ($ this ->once ())
137137 ->method ('set ' )
138138 ->with ('user_id ' , 'foo ' );
@@ -151,7 +151,7 @@ public function testSetUser() {
151151 }
152152
153153 public function testLoginValidPasswordEnabled () {
154- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
154+ $ session = $ this ->createMock (Memory::class);
155155 $ session ->expects ($ this ->once ())
156156 ->method ('regenerateId ' );
157157 $ this ->tokenProvider ->expects ($ this ->once ())
@@ -228,7 +228,7 @@ public function testLoginValidPasswordEnabled() {
228228 public function testLoginValidPasswordDisabled () {
229229 $ this ->expectException (LoginException::class);
230230
231- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
231+ $ session = $ this ->createMock (Memory::class);
232232 $ session ->expects ($ this ->never ())
233233 ->method ('set ' );
234234 $ session ->expects ($ this ->once ())
@@ -270,7 +270,7 @@ public function testLoginValidPasswordDisabled() {
270270 }
271271
272272 public function testLoginInvalidPassword () {
273- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
273+ $ session = $ this ->createMock (Memory::class);
274274 $ managerMethods = get_class_methods (Manager::class);
275275 //keep following methods intact in order to ensure hooks are working
276276 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -313,7 +313,7 @@ public function testLoginInvalidPassword() {
313313 }
314314
315315 public function testPasswordlessLoginNoLastCheckUpdate (): void {
316- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
316+ $ session = $ this ->createMock (Memory::class);
317317 $ managerMethods = get_class_methods (Manager::class);
318318 // Keep following methods intact in order to ensure hooks are working
319319 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -350,7 +350,7 @@ public function testPasswordlessLoginNoLastCheckUpdate(): void {
350350 }
351351
352352 public function testLoginLastCheckUpdate (): void {
353- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
353+ $ session = $ this ->createMock (Memory::class);
354354 $ managerMethods = get_class_methods (Manager::class);
355355 // Keep following methods intact in order to ensure hooks are working
356356 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -387,7 +387,7 @@ public function testLoginLastCheckUpdate(): void {
387387 }
388388
389389 public function testLoginNonExisting () {
390- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
390+ $ session = $ this ->createMock (Memory::class);
391391 $ manager = $ this ->createMock (Manager::class);
392392 $ userSession = new Session ($ manager , $ session , $ this ->timeFactory , $ this ->tokenProvider , $ this ->config , $ this ->random , $ this ->lockdownManager , $ this ->logger , $ this ->dispatcher );
393393
@@ -607,7 +607,7 @@ public function testTryTokenLoginSessionIdTokenNotFound(): void {
607607 }
608608
609609 public function testRememberLoginValidToken () {
610- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
610+ $ session = $ this ->createMock (Memory::class);
611611 $ managerMethods = get_class_methods (Manager::class);
612612 //keep following methods intact in order to ensure hooks are working
613613 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -696,7 +696,7 @@ public function testRememberLoginValidToken() {
696696 }
697697
698698 public function testRememberLoginInvalidSessionToken () {
699- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
699+ $ session = $ this ->createMock (Memory::class);
700700 $ managerMethods = get_class_methods (Manager::class);
701701 //keep following methods intact in order to ensure hooks are working
702702 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -760,7 +760,7 @@ public function testRememberLoginInvalidSessionToken() {
760760 }
761761
762762 public function testRememberLoginInvalidToken () {
763- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
763+ $ session = $ this ->createMock (Memory::class);
764764 $ managerMethods = get_class_methods (Manager::class);
765765 //keep following methods intact in order to ensure hooks are working
766766 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -812,7 +812,7 @@ public function testRememberLoginInvalidToken() {
812812 }
813813
814814 public function testRememberLoginInvalidUser () {
815- $ session = $ this ->getMockBuilder (Memory::class)-> setConstructorArgs ([ '' ])-> getMock ( );
815+ $ session = $ this ->createMock (Memory::class);
816816 $ managerMethods = get_class_methods (Manager::class);
817817 //keep following methods intact in order to ensure hooks are working
818818 $ mockedManagerMethods = array_diff ($ managerMethods , ['__construct ' , 'emit ' , 'listen ' ]);
@@ -872,7 +872,7 @@ public function testActiveUserAfterSetSession() {
872872 return $ users [$ uid ];
873873 });
874874
875- $ session = new Memory ('' );
875+ $ session = new Memory ();
876876 $ session ->set ('user_id ' , 'foo ' );
877877 $ userSession = $ this ->getMockBuilder (Session::class)
878878 ->setConstructorArgs ([$ manager , $ session , $ this ->timeFactory , $ this ->tokenProvider , $ this ->config , $ this ->random , $ this ->lockdownManager , $ this ->logger , $ this ->dispatcher ])
@@ -885,7 +885,7 @@ public function testActiveUserAfterSetSession() {
885885
886886 $ this ->assertEquals ($ users ['foo ' ], $ userSession ->getUser ());
887887
888- $ session2 = new Memory ('' );
888+ $ session2 = new Memory ();
889889 $ session2 ->set ('user_id ' , 'bar ' );
890890 $ userSession ->setSession ($ session2 );
891891 $ this ->assertEquals ($ users ['bar ' ], $ userSession ->getUser ());
0 commit comments