File tree 1 file changed +3
-2
lines changed
app/code/Magento/Security/Test/Unit/Observer 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ public function testWithExpiredUser()
95
95
->method ('userIsExpired ' )
96
96
->with ($ this ->userMock )
97
97
->willReturn (true );
98
- $ this ->userMock ->expects (static ::once ( ))->method ('getId ' )->willReturn ($ adminUserId );
98
+ $ this ->userMock ->expects (static ::exactly ( 2 ))->method ('getId ' )->willReturn ($ adminUserId );
99
99
$ this ->userExpirationManagerMock ->expects (static ::once ())
100
100
->method ('deactivateExpiredUsers ' )
101
101
->with ([$ adminUserId ])
@@ -105,11 +105,12 @@ public function testWithExpiredUser()
105
105
106
106
public function testWithNonExpiredUser ()
107
107
{
108
+ $ adminUserId = 123 ;
108
109
$ username = 'testuser ' ;
109
110
$ this ->eventObserverMock ->expects (static ::once ())->method ('getEvent ' )->willReturn ($ this ->eventMock );
110
111
$ this ->eventMock ->expects (static ::once ())->method ('getUsername ' )->willReturn ($ username );
111
112
$ this ->userMock ->expects (static ::once ())->method ('loadByUsername ' )->willReturn ($ this ->userMock );
112
-
113
+ $ this -> userMock -> expects ( static :: once ())-> method ( ' getId ' )-> willReturn ( $ adminUserId );
113
114
$ this ->userExpirationManagerMock ->expects (static ::once ())
114
115
->method ('userIsExpired ' )
115
116
->with ($ this ->userMock )
You can’t perform that action at this time.
0 commit comments