File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -244,6 +244,26 @@ public function unblock(int $id)
244
244
return $ this ->post ('users/ ' .self ::encodePath ($ id ).'/unblock ' );
245
245
}
246
246
247
+ /**
248
+ * @param int $id
249
+ *
250
+ * @return mixed
251
+ */
252
+ public function activate (int $ id )
253
+ {
254
+ return $ this ->post ('users/ ' .self ::encodePath ($ id ).'/activate ' );
255
+ }
256
+
257
+ /**
258
+ * @param int $id
259
+ *
260
+ * @return mixed
261
+ */
262
+ public function deactivate (int $ id )
263
+ {
264
+ return $ this ->post ('users/ ' .self ::encodePath ($ id ).'/deactivate ' );
265
+ }
266
+
247
267
/**
248
268
* @return mixed
249
269
*/
Original file line number Diff line number Diff line change @@ -407,6 +407,40 @@ public function shouldUnblockUser(): void
407
407
$ this ->assertEquals ($ expectedBool , $ api ->unblock (1 ));
408
408
}
409
409
410
+ /**
411
+ * @test
412
+ */
413
+ public function shouldActivateUser (): void
414
+ {
415
+ $ expectedBool = true ;
416
+
417
+ $ api = $ this ->getApiMock ();
418
+ $ api ->expects ($ this ->once ())
419
+ ->method ('post ' )
420
+ ->with ('users/1/activate ' )
421
+ ->will ($ this ->returnValue ($ expectedBool ))
422
+ ;
423
+
424
+ $ this ->assertEquals ($ expectedBool , $ api ->activate (1 ));
425
+ }
426
+
427
+ /**
428
+ * @test
429
+ */
430
+ public function shouldDeactivateUser (): void
431
+ {
432
+ $ expectedBool = true ;
433
+
434
+ $ api = $ this ->getApiMock ();
435
+ $ api ->expects ($ this ->once ())
436
+ ->method ('post ' )
437
+ ->with ('users/1/deactivate ' )
438
+ ->will ($ this ->returnValue ($ expectedBool ))
439
+ ;
440
+
441
+ $ this ->assertEquals ($ expectedBool , $ api ->deactivate (1 ));
442
+ }
443
+
410
444
/**
411
445
* @test
412
446
*/
You can’t perform that action at this time.
0 commit comments