1
0
Fork 0
mirror of synced 2024-07-03 05:31:38 +12:00
appwrite/tests/e2e/Services/Account/AccountCustomServerTest.php

39 lines
988 B
PHP
Raw Normal View History

2020-01-12 02:58:02 +13:00
<?php
2020-01-12 19:35:37 +13:00
namespace Tests\E2E\Services\Account;
2020-01-12 02:58:02 +13:00
2020-01-12 19:35:37 +13:00
use Tests\E2E\Client;
2020-01-12 10:53:57 +13:00
use Tests\E2E\Scopes\ProjectCustom;
2020-01-12 02:58:02 +13:00
use Tests\E2E\Scopes\Scope;
2020-01-12 10:53:57 +13:00
use Tests\E2E\Scopes\SideServer;
2020-01-12 02:58:02 +13:00
2020-01-12 10:53:57 +13:00
class AccountCustomServerTest extends Scope
2020-01-12 02:58:02 +13:00
{
2020-01-12 10:53:57 +13:00
use ProjectCustom;
use SideServer;
public function testCreateAccount():array
{
$email = uniqid().'user@localhost.test';
$password = 'password';
$name = 'User Name';
/**
2020-01-13 00:11:16 +13:00
* Test for FAILURE
2020-01-12 10:53:57 +13:00
*/
$response = $this->client->call(Client::METHOD_POST, '/account', [
'content-type' => 'application/json',
2020-02-17 20:16:11 +13:00
'x-appwrite-project' => $this->getProject()['$id'],
2020-01-13 00:11:16 +13:00
'x-appwrite-key' => $this->getProject()['apiKey'],
2020-01-12 10:53:57 +13:00
], [
2021-08-05 17:02:55 +12:00
'userId' => 'unique()',
2020-01-12 10:53:57 +13:00
'email' => $email,
'password' => $password,
'name' => $name,
]);
$this->assertEquals(401, $response['headers']['status-code']);
return [];
}
2020-01-12 02:58:02 +13:00
}