diff --git a/src/Api/Users.php b/src/Api/Users.php index 6d07f8c3..bbc828e8 100644 --- a/src/Api/Users.php +++ b/src/Api/Users.php @@ -244,6 +244,26 @@ public function unblock(int $id) return $this->post('users/'.self::encodePath($id).'/unblock'); } + /** + * @param int $id + * + * @return mixed + */ + public function activate(int $id) + { + return $this->post('users/'.self::encodePath($id).'/activate'); + } + + /** + * @param int $id + * + * @return mixed + */ + public function deactivate(int $id) + { + return $this->post('users/'.self::encodePath($id).'/deactivate'); + } + /** * @return mixed */ diff --git a/tests/Api/UsersTest.php b/tests/Api/UsersTest.php index 4dafb0ba..dee422d0 100644 --- a/tests/Api/UsersTest.php +++ b/tests/Api/UsersTest.php @@ -407,6 +407,40 @@ public function shouldUnblockUser(): void $this->assertEquals($expectedBool, $api->unblock(1)); } + /** + * @test + */ + public function shouldActivateUser(): void + { + $expectedBool = true; + + $api = $this->getApiMock(); + $api->expects($this->once()) + ->method('post') + ->with('users/1/activate') + ->will($this->returnValue($expectedBool)) + ; + + $this->assertEquals($expectedBool, $api->activate(1)); + } + + /** + * @test + */ + public function shouldDeactivateUser(): void + { + $expectedBool = true; + + $api = $this->getApiMock(); + $api->expects($this->once()) + ->method('post') + ->with('users/1/deactivate') + ->will($this->returnValue($expectedBool)) + ; + + $this->assertEquals($expectedBool, $api->deactivate(1)); + } + /** * @test */