appwrite/tests/e2e/AccountCustomServerTest.php

37 lines
914 B
PHP
Raw Normal View History

2020-01-11 13:58:02 +00:00
<?php
namespace Tests\E2E;
2020-01-11 21:53:57 +00:00
use Tests\E2E\Scopes\ProjectCustom;
2020-01-11 13:58:02 +00:00
use Tests\E2E\Scopes\Scope;
2020-01-11 21:53:57 +00:00
use Tests\E2E\Scopes\SideServer;
2020-01-11 13:58:02 +00:00
2020-01-11 21:53:57 +00:00
class AccountCustomServerTest extends Scope
2020-01-11 13:58:02 +00:00
{
2020-01-11 21:53:57 +00:00
use ProjectCustom;
use SideServer;
public function testCreateAccount():array
{
$email = uniqid().'user@localhost.test';
$password = 'password';
$name = 'User Name';
/**
* Test for SUCCESS
*/
$response = $this->client->call(Client::METHOD_POST, '/account', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$uid'],
'X-Appwrite-Key' => $this->getProject()['apiKey'],
], [
'email' => $email,
'password' => $password,
'name' => $name,
]);
$this->assertEquals(401, $response['headers']['status-code']);
return [];
}
2020-01-11 13:58:02 +00:00
}