1
0
Fork 0
mirror of synced 2024-06-14 00:34:51 +12:00
appwrite/tests/e2e/General/UsageTest.php
Damodar Lohani 7a58814c61 WIP
2022-06-30 04:27:11 +00:00

45 lines
1.2 KiB
PHP

<?php
use PHPUnit\Framework\TestCase;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
class UsageTest extends Scope {
use ProjectCustom;
use SideServer;
protected array $headers = [];
protected array $project;
protected int $usersCount = 0;
protected int $requestsCount = 0;
protected function setUp(): void {
$this->project = $this->getProject(true);
$this->headers['x-appwrite-project'] = $this->project['$id'];
$this->headers['x-appwrite-key'] = $this->project['apiKey'];
$this->headers['content-type'] = 'application/json';
}
public function testUsersStats(): void
{
for($i = 0; $i<10; $i++) {
$email = uniqid() . 'user@usage.test';
$password = 'password';
$name = uniqid() . 'User';
$user = $this->client->call(Client::METHOD_POST, '/users', $this->headers, [
'userId' => 'unique()',
'email' => $email,
'password' => $password,
'name' => $name,
]);
$this->usersCount++;
$this->requestsCount++;
}
}
}