1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00
appwrite/tests/e2e/Services/Teams/TeamsBaseClient.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2020-01-17 03:06:28 +13:00
<?php
namespace Tests\E2E\Services\Teams;
use Tests\E2E\Client;
trait TeamsBaseClient
{
/**
* @depends testCreateTeam
*/
public function testGetTeamMembers($data):array
{
$uid = (isset($data['teamUid'])) ? $data['teamUid'] : '';
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_GET, '/teams/'.$uid.'/members', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$uid'],
], $this->getHeaders()));
$this->assertEquals(200, $response['headers']['status-code']);
$this->assertNotEmpty($response['body'][0]['$uid']);
$this->assertEquals($this->getUser()['$uid'], $response['body'][0]['$uid']);
$this->assertEquals($this->getUser()['name'], $response['body'][0]['name']);
$this->assertEquals($this->getUser()['email'], $response['body'][0]['email']);
$this->assertEquals('owner', $response['body'][0]['roles'][0]);
/**
* Test for FAILURE
*/
return [];
}
}