1
0
Fork 0
mirror of synced 2024-06-03 11:24:48 +12:00
appwrite/tests/e2e/Services/Account/AccountCustomServerTest.php
2020-02-17 09:16:11 +02:00

38 lines
952 B
PHP

<?php
namespace Tests\E2E\Services\Account;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
class AccountCustomServerTest extends Scope
{
use ProjectCustom;
use SideServer;
public function testCreateAccount():array
{
$email = uniqid().'user@localhost.test';
$password = 'password';
$name = 'User Name';
/**
* Test for FAILURE
*/
$response = $this->client->call(Client::METHOD_POST, '/account', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'email' => $email,
'password' => $password,
'name' => $name,
]);
$this->assertEquals(401, $response['headers']['status-code']);
return [];
}
}