Remove redundant tests
This commit is contained in:
parent
f18fb13afd
commit
e388f1f8e2
1 changed files with 0 additions and 165 deletions
|
@ -3135,171 +3135,6 @@ class ProjectsConsoleClientTest extends Scope
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Domains
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testCreateProject
|
|
||||||
*/
|
|
||||||
public function testCreateProjectDomain($data): array
|
|
||||||
{
|
|
||||||
$id = $data['projectId'] ?? '';
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/domains', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), [
|
|
||||||
'domain' => 'sub.example.com',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertEquals(201, $response['headers']['status-code']);
|
|
||||||
$this->assertNotEmpty($response['body']['$id']);
|
|
||||||
// $this->assertIsInt($response['body']['updated']);
|
|
||||||
$this->assertEquals('sub.example.com', $response['body']['domain']);
|
|
||||||
$this->assertEquals('com', $response['body']['tld']);
|
|
||||||
$this->assertEquals('example.com', $response['body']['registerable']);
|
|
||||||
$this->assertEquals(false, $response['body']['verification']);
|
|
||||||
|
|
||||||
$data = array_merge($data, ['domainId' => $response['body']['$id']]);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for FAILURE
|
|
||||||
*/
|
|
||||||
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), [
|
|
||||||
'domain' => '123',
|
|
||||||
]);
|
|
||||||
|
|
||||||
$this->assertEquals(400, $response['headers']['status-code']);
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_POST, '/projects/' . $id . '/platforms', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), [
|
|
||||||
'type' => 'web',
|
|
||||||
'name' => 'Too Long Hostname',
|
|
||||||
'hostname' => \str_repeat("bestdomain", 25) . '.com' // 250 + 4 chars total (exactly above limit)
|
|
||||||
]);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testCreateProjectDomain
|
|
||||||
*/
|
|
||||||
public function testListProjectDomain($data): array
|
|
||||||
{
|
|
||||||
$id = $data['projectId'] ?? '';
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
|
||||||
$this->assertEquals(1, $response['body']['total']);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for FAILURE
|
|
||||||
*/
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testCreateProjectDomain
|
|
||||||
*/
|
|
||||||
public function testGetProjectDomain($data): array
|
|
||||||
{
|
|
||||||
$id = $data['projectId'] ?? '';
|
|
||||||
$domainId = $data['domainId'] ?? '';
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/' . $domainId, array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(200, $response['headers']['status-code']);
|
|
||||||
$this->assertNotEmpty($response['body']['$id']);
|
|
||||||
$this->assertEquals($domainId, $response['body']['$id']);
|
|
||||||
// $this->assertIsInt($response['body']['updated']);
|
|
||||||
$this->assertEquals('sub.example.com', $response['body']['domain']);
|
|
||||||
$this->assertEquals('com', $response['body']['tld']);
|
|
||||||
$this->assertEquals('example.com', $response['body']['registerable']);
|
|
||||||
$this->assertEquals(false, $response['body']['verification']);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for FAILURE
|
|
||||||
*/
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/error', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(404, $response['headers']['status-code']);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testCreateProjectDomain
|
|
||||||
*/
|
|
||||||
public function testUpdateProjectDomain($data): array
|
|
||||||
{
|
|
||||||
$id = $data['projectId'] ?? '';
|
|
||||||
$domainId = $data['domainId'] ?? '';
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_PATCH, '/projects/' . $id . '/domains/' . $domainId . '/verification', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(401, $response['headers']['status-code']);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for FAILURE
|
|
||||||
*/
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @depends testCreateProjectDomain
|
|
||||||
*/
|
|
||||||
public function testDeleteProjectDomain($data): array
|
|
||||||
{
|
|
||||||
$id = $data['projectId'] ?? '';
|
|
||||||
$domainId = $data['domainId'] ?? '';
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/domains/' . $domainId, array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(204, $response['headers']['status-code']);
|
|
||||||
$this->assertEmpty($response['body']);
|
|
||||||
|
|
||||||
$response = $this->client->call(Client::METHOD_GET, '/projects/' . $id . '/domains/' . $domainId, array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(404, $response['headers']['status-code']);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Test for FAILURE
|
|
||||||
*/
|
|
||||||
$response = $this->client->call(Client::METHOD_DELETE, '/projects/' . $id . '/domains/error', array_merge([
|
|
||||||
'content-type' => 'application/json',
|
|
||||||
'x-appwrite-project' => $this->getProject()['$id'],
|
|
||||||
], $this->getHeaders()), []);
|
|
||||||
|
|
||||||
$this->assertEquals(404, $response['headers']['status-code']);
|
|
||||||
|
|
||||||
return $data;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testDeleteProject(): array
|
public function testDeleteProject(): array
|
||||||
{
|
{
|
||||||
$data = [];
|
$data = [];
|
||||||
|
|
Loading…
Reference in a new issue