1
0
Fork 0
mirror of synced 2024-06-26 10:10:57 +12:00

Completed teams service e2e tests

This commit is contained in:
Eldad Fux 2020-01-19 15:36:30 +02:00
parent 5e4c124cae
commit 55c89d47e8

View file

@ -199,6 +199,41 @@ trait TeamsBaseClient
$this->assertEquals(400, $response['headers']['status-code']);
return $data;
}
/**
* @depends testUpdateTeamMembership
*/
public function testDeleteTeamMembership($data):array
{
$teamUid = (isset($data['teamUid'])) ? $data['teamUid'] : '';
$inviteUid = (isset($data['inviteUid'])) ? $data['inviteUid'] : '';
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_DELETE, '/teams/'.$teamUid.'/memberships/'.$inviteUid, array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$uid'],
], $this->getHeaders()));
$this->assertEquals(204, $response['headers']['status-code']);
$this->assertEmpty($response['body']);
/**
* Test for FAILURE
*/
$response = $this->client->call(Client::METHOD_GET, '/teams/'.$teamUid.'/memberships/'.$inviteUid, array_merge([
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$uid'],
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertCount(1, $response['body']);
return [];
}
}