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

More teams service tests

This commit is contained in:
Eldad Fux 2020-01-19 12:43:06 +02:00
parent 7799ef47ec
commit 3ee4328fa2

View file

@ -56,8 +56,6 @@ trait TeamsBaseClient
'url' => 'http://localhost:5000/join-us#title'
]);
if ($response['headers']['status-code'] !== 201) {var_dump($response);}
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertNotEmpty($response['body']['$uid']);
$this->assertNotEmpty($response['body']['userId']);
@ -69,12 +67,18 @@ trait TeamsBaseClient
/**
* Test for FAILURE
*/
// $response = $this->client->call(Client::METHOD_POST, '/teams/'.$uid.'/memberships', array_merge([
// 'content-type' => 'application/json',
// 'x-appwrite-project' => $this->getProject()['$uid'],
// ], $this->getHeaders()));
// $this->assertEquals(404, $response['headers']['status-code']);
$response = $this->client->call(Client::METHOD_POST, '/teams/'.$uid.'/memberships', array_merge([
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$uid'],
], $this->getHeaders()), [
'email' => 'dasdkaskdjaskdjasjkd',
'name' => 'Friend User',
'roles' => ['admin', 'editor'],
'url' => 'http://localhost:5000/join-us#title'
]);
$this->assertEquals(400, $response['headers']['status-code']);
return [];
}