1
0
Fork 0
mirror of synced 2024-05-20 04:32:37 +12:00
This commit is contained in:
Damodar Lohani 2024-05-05 10:47:54 +05:45 committed by GitHub
parent 99cb38c674
commit 7ca9e6923f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,17 +2,43 @@
namespace Tests\E2E\Services\Projects;
use Tests\E2E\Client;
use Tests\E2E\Scopes\ProjectCustom;
use Tests\E2E\Scopes\Scope;
use Tests\E2E\Scopes\SideServer;
use Utopia\System\System;
class ProjectsCustomServerTest extends Scope
{
use ProjectCustom;
use SideServer;
public function testMock()
// Domains
public function testCreateProjectRule()
{
$this->assertEquals(true, true);
$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']);
// prevent functions domain
$functionsDomain = System::getEnv('_APP_DOMAIN_FUNCTIONS', '');
$response = $this->client->call(Client::METHOD_POST, '/proxy/rules', $headers, [
'resourceType' => 'api',
'domain' => $functionsDomain,
]);
$this->assertEquals(400, $response['headers']['status-code']);
}
}