2020-07-08 09:11:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Tests\E2E\Services\Projects;
|
|
|
|
|
|
2024-05-05 04:56:49 +00:00
|
|
|
use Tests\E2E\Client;
|
2020-07-08 09:11:12 +00:00
|
|
|
use Tests\E2E\Scopes\ProjectCustom;
|
|
|
|
|
use Tests\E2E\Scopes\Scope;
|
|
|
|
|
use Tests\E2E\Scopes\SideServer;
|
|
|
|
|
|
|
|
|
|
class ProjectsCustomServerTest extends Scope
|
|
|
|
|
{
|
|
|
|
|
use ProjectCustom;
|
|
|
|
|
use SideServer;
|
|
|
|
|
|
2024-05-05 04:56:49 +00:00
|
|
|
// Domains
|
|
|
|
|
|
|
|
|
|
public function testCreateProjectRule()
|
|
|
|
|
{
|
|
|
|
|
$headers = array_merge([
|
|
|
|
|
'content-type' => 'application/json',
|
|
|
|
|
'x-appwrite-project' => $this->getProject()['$id'],
|
|
|
|
|
'x-appwrite-mode' => 'admin',
|
|
|
|
|
'cookie' => 'a_session_console=' . $this->getRoot()['session'],
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$response = $this->client->call(Client::METHOD_POST, '/proxy/rules', $headers, [
|
|
|
|
|
'resourceType' => 'api',
|
|
|
|
|
'domain' => 'api.appwrite.test',
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(201, $response['headers']['status-code']);
|
|
|
|
|
|
2024-05-22 21:19:21 +00:00
|
|
|
$response = $this->client->call(Client::METHOD_DELETE, '/proxy/rules/' . $response['body']['$id'], $headers);
|
|
|
|
|
|
|
|
|
|
$this->assertEquals(204, $response['headers']['status-code']);
|
2024-05-05 04:56:49 +00:00
|
|
|
}
|
2022-05-23 14:54:50 +00:00
|
|
|
}
|