2019-09-17 16:21:20 +12:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Tests\E2E;
|
|
|
|
|
|
|
|
use Tests\E2E\Client;
|
|
|
|
|
|
|
|
class BaseProjects extends BaseConsole
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @var Client
|
|
|
|
*/
|
|
|
|
protected $projectsDemoEmail = '';
|
|
|
|
protected $projectsDemoPassword = '';
|
|
|
|
|
2019-11-04 08:05:26 +13:00
|
|
|
protected function setUp(): void
|
2019-09-17 16:21:20 +12:00
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
|
2019-09-30 19:13:40 +13:00
|
|
|
$this->projectsDemoEmail = 'user.' . rand(0, 1000000) . '@appwrite.io';
|
|
|
|
$this->projectsDemoPassword = 'password.' . rand(0, 1000000);
|
2019-09-17 16:21:20 +12:00
|
|
|
}
|
|
|
|
|
2019-11-04 08:05:26 +13:00
|
|
|
protected function tearDown(): void
|
2019-09-17 16:21:20 +12:00
|
|
|
{
|
|
|
|
parent::tearDown();
|
|
|
|
|
|
|
|
$this->client = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function projectRegister($projectId)
|
|
|
|
{
|
2019-09-17 18:23:11 +12:00
|
|
|
$response = $this->client->call(Client::METHOD_POST, '/auth/register', [
|
2019-09-17 16:21:20 +12:00
|
|
|
'origin' => 'http://localhost',
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
'x-appwrite-project' => $projectId,
|
|
|
|
], [
|
|
|
|
'email' => $this->projectsDemoEmail,
|
|
|
|
'password' => $this->projectsDemoPassword,
|
2019-09-29 11:55:54 +13:00
|
|
|
'confirm' => 'http://localhost/confirm',
|
2019-09-17 16:21:20 +12:00
|
|
|
'success' => 'http://localhost/success',
|
|
|
|
'failure' => 'http://localhost/failure',
|
|
|
|
'name' => 'Porject Demo User',
|
|
|
|
]);
|
|
|
|
|
|
|
|
return $response;
|
|
|
|
}
|
2019-09-30 19:13:40 +13:00
|
|
|
}
|