1
0
Fork 0
mirror of synced 2024-07-01 04:30:59 +12:00
appwrite/tests/e2e/BaseProjects.php
2019-09-21 12:32:24 +03:00

47 lines
1.1 KiB
PHP

<?php
namespace Tests\E2E;
use Tests\E2E\Client;
class BaseProjects extends BaseConsole
{
/**
* @var Client
*/
protected $projectsDemoEmail = '';
protected $projectsDemoPassword = '';
public function setUp()
{
parent::setUp();
$this->projectsDemoEmail = 'user.' . rand(0,1000000) . '@appwrite.io';
$this->projectsDemoPassword = 'password.' . rand(0,1000000);
}
public function tearDown()
{
parent::tearDown();
$this->client = null;
}
public function projectRegister($projectId)
{
$response = $this->client->call(Client::METHOD_POST, '/auth/register', [
'origin' => 'http://localhost',
'content-type' => 'application/json',
'x-appwrite-project' => $projectId,
], [
'email' => $this->projectsDemoEmail,
'password' => $this->projectsDemoPassword,
'confirmation' => 'http://localhost/confirm',
'success' => 'http://localhost/success',
'failure' => 'http://localhost/failure',
'name' => 'Porject Demo User',
]);
return $response;
}
}