-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add functionality to remove member form community.
- Loading branch information
1 parent
9c1090d
commit 98cbe1e
Showing
4 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,4 +120,36 @@ public function test_member_update_failed(): void | |
data: ['first_name' => 'Adroeck'], | ||
); | ||
} | ||
|
||
public function test_member_removed_ok(): void | ||
{ | ||
$circleSo = $this->getSdkWithMockedClient([ | ||
new Response(200, [], json_response('remove_member')), | ||
]); | ||
|
||
$response = $circleSo->members() | ||
->communityId(1) | ||
->remove('[email protected]'); | ||
|
||
$this->assertSame(true, $response['success']); | ||
$this->assertSame('This user has been removed from the community.', $response['message']); | ||
} | ||
|
||
public function test_member_removed_failed(): void | ||
{ | ||
$this->expectException(UnsuccessfulResponseException::class); | ||
$this->expectExceptionMessage( | ||
'This user could not be removed. Please ensure that the user and community specified exists, and that the user is a member of the community.' | ||
); | ||
$this->expectExceptionCode(500); | ||
|
||
$circleSo = $this->getSdkWithMockedClient([ | ||
new Response(200, [], json_response('remove_member_failed')), | ||
]); | ||
|
||
$circleSo->members() | ||
->communityId(1) | ||
->remove('[email protected]'); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"success": true, | ||
"message": "This user has been removed from the community." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"success": false, | ||
"message": "This user could not be removed. Please ensure that the user and community specified exists, and that the user is a member of the community." | ||
} |