File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,25 @@ public function test_throwing_exception_if_user_is_not_exist() {
237
237
$ this ->expectExceptionMessage ('Invalid parameter value detected (User is not exist) ' );
238
238
$ actual = $ this ->auth ->get_login_url ($ user );
239
239
}
240
+ /**
241
+ * Test that auth plugin throws correct exception if we trying to request not existing user.
242
+ */
243
+ public function test_throwing_exception_if_user_is_suspended () {
244
+ global $ USER ;
245
+
246
+ $ user = $ this ->getDataGenerator ()->create_user ();
247
+ $ user ->suspended = 1 ;
248
+ $ this ->setUser ($ user );
249
+ $ this ->assertEquals ($ USER ->id , $ user ->id );
250
+
251
+ $ this ->create_user_private_key ();
252
+ $ _POST ['key ' ] = 'TestKey ' ;
253
+
254
+ $ this ->expectException (invalid_parameter_exception::class);
255
+ $ this ->expectExceptionMessage ('Invalid parameter value detected (User is suspended) ' );
256
+
257
+ $ this ->auth ->user_login_userkey ();
258
+ }
240
259
241
260
/**
242
261
* Test that auth plugin throws correct exception if we trying to request user,
You can’t perform that action at this time.
0 commit comments