From 978f6463fca5232aaf0445f2c69351fc69345c8d Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Wed, 12 May 2021 22:32:08 +0530 Subject: [PATCH] feat: uncomment tests --- tests/e2e/Services/Teams/TeamsBaseClient.php | 106 +++++++++---------- 1 file changed, 53 insertions(+), 53 deletions(-) diff --git a/tests/e2e/Services/Teams/TeamsBaseClient.php b/tests/e2e/Services/Teams/TeamsBaseClient.php index 478eccb943..1f8a9ec950 100644 --- a/tests/e2e/Services/Teams/TeamsBaseClient.php +++ b/tests/e2e/Services/Teams/TeamsBaseClient.php @@ -6,34 +6,34 @@ use Tests\E2E\Client; trait TeamsBaseClient { - // /** - // * @depends testCreateTeam - // */ - // public function testGetTeamMemberships($data):array - // { - // $teamUid = $data['teamUid'] ?? ''; + /** + * @depends testCreateTeam + */ + public function testGetTeamMemberships($data):array + { + $teamUid = $data['teamUid'] ?? ''; - // /** - // * Test for SUCCESS - // */ - // $response = $this->client->call(Client::METHOD_GET, '/teams/'.$teamUid.'/memberships', array_merge([ - // 'content-type' => 'application/json', - // 'x-appwrite-project' => $this->getProject()['$id'], - // ], $this->getHeaders())); + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/'.$teamUid.'/memberships', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - // $this->assertEquals(200, $response['headers']['status-code']); - // $this->assertIsInt($response['body']['sum']); - // $this->assertNotEmpty($response['body']['memberships'][0]['$id']); - // $this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']); - // $this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']); - // $this->assertEquals('owner', $response['body']['memberships'][0]['roles'][0]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertIsInt($response['body']['sum']); + $this->assertNotEmpty($response['body']['memberships'][0]['$id']); + $this->assertEquals($this->getUser()['name'], $response['body']['memberships'][0]['name']); + $this->assertEquals($this->getUser()['email'], $response['body']['memberships'][0]['email']); + $this->assertEquals('owner', $response['body']['memberships'][0]['roles'][0]); - // /** - // * Test for FAILURE - // */ + /** + * Test for FAILURE + */ - // return $data; - // } + return $data; + } /** * @depends testCreateTeam @@ -205,40 +205,40 @@ trait TeamsBaseClient return $data; } - // /** - // * @depends testUpdateTeamMembership - // */ - // public function testDeleteTeamMembership($data):array - // { - // $teamUid = $data['teamUid'] ?? ''; - // $membershipUid = $data['membershipUid'] ?? ''; + /** + * @depends testUpdateTeamMembership + */ + public function testDeleteTeamMembership($data):array + { + $teamUid = $data['teamUid'] ?? ''; + $membershipUid = $data['membershipUid'] ?? ''; - // /** - // * Test for SUCCESS - // */ - // $response = $this->client->call(Client::METHOD_DELETE, '/teams/'.$teamUid.'/memberships/'.$membershipUid, array_merge([ - // 'origin' => 'http://localhost', - // 'content-type' => 'application/json', - // 'x-appwrite-project' => $this->getProject()['$id'], - // ], $this->getHeaders())); + /** + * Test for SUCCESS + */ + $response = $this->client->call(Client::METHOD_DELETE, '/teams/'.$teamUid.'/memberships/'.$membershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - // $this->assertEquals(204, $response['headers']['status-code']); - // $this->assertEmpty($response['body']); + $this->assertEquals(204, $response['headers']['status-code']); + $this->assertEmpty($response['body']); - // /** - // * Test for FAILURE - // */ - // $response = $this->client->call(Client::METHOD_GET, '/teams/'.$teamUid.'/memberships/'.$membershipUid, array_merge([ - // 'origin' => 'http://localhost', - // 'content-type' => 'application/json', - // 'x-appwrite-project' => $this->getProject()['$id'], - // ], $this->getHeaders())); + /** + * Test for FAILURE + */ + $response = $this->client->call(Client::METHOD_GET, '/teams/'.$teamUid.'/memberships/'.$membershipUid, array_merge([ + 'origin' => 'http://localhost', + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders())); - // $this->assertEquals(200, $response['headers']['status-code']); - // $this->assertCount(1, $response['body']['memberships']); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['memberships']); - // return []; - // } + return []; + } /** * @depends testUpdateTeamMembership