mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Move test tp base
This commit is contained in:
@@ -2995,8 +2995,7 @@ App::get('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
->param('queries', [], new ArrayList(new Text(APP_LIMIT_ARRAY_ELEMENT_SIZE), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' queries are allowed, each ' . APP_LIMIT_ARRAY_ELEMENT_SIZE . ' characters long.', true)
|
||||
->inject('response')
|
||||
->inject('dbForProject')
|
||||
->inject('mode')
|
||||
->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject, string $mode) {
|
||||
->action(function (string $databaseId, string $collectionId, array $queries, Response $response, Database $dbForProject) {
|
||||
$database = Authorization::skip(fn () => $dbForProject->getDocument('databases', $databaseId));
|
||||
$isAPIKey = Auth::isAppUser(Authorization::getRoles());
|
||||
$isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles());
|
||||
|
||||
@@ -221,6 +221,34 @@ trait DatabasesBase
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateCollection
|
||||
*/
|
||||
public function testConsoleProject(array $data)
|
||||
{
|
||||
$response = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => 'console',
|
||||
], $this->getHeaders())
|
||||
);
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
|
||||
$response = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
array_merge([
|
||||
'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => '', disabled
|
||||
], $this->getHeaders())
|
||||
);
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateCollection
|
||||
*/
|
||||
|
||||
@@ -331,32 +331,32 @@ class DatabasesConsoleClientTest extends Scope
|
||||
$this->assertLessThanOrEqual(1, count($logs['body']['logs']));
|
||||
$this->assertIsNumeric($logs['body']['total']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @depends testCreateCollection
|
||||
*/
|
||||
public function testConsoleProject(array $data)
|
||||
{
|
||||
$response = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => 'console',
|
||||
], $this->getHeaders())
|
||||
);
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
|
||||
$response = $this->client->call(
|
||||
Client::METHOD_GET,
|
||||
'/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
array_merge([
|
||||
'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => '', disabled
|
||||
], $this->getHeaders())
|
||||
);
|
||||
$this->assertEquals(400, $response['headers']['status-code']);
|
||||
$this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
}
|
||||
//
|
||||
// /**
|
||||
// * @depends testCreateCollection
|
||||
// */
|
||||
// public function testConsoleProject(array $data)
|
||||
// {
|
||||
// $response = $this->client->call(
|
||||
// Client::METHOD_GET,
|
||||
// '/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
// array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// 'x-appwrite-project' => 'console',
|
||||
// ], $this->getHeaders())
|
||||
// );
|
||||
// $this->assertEquals(400, $response['headers']['status-code']);
|
||||
// $this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
//
|
||||
// $response = $this->client->call(
|
||||
// Client::METHOD_GET,
|
||||
// '/databases/console/collections/' . $data['moviesId'] . '/documents',
|
||||
// array_merge([
|
||||
// 'content-type' => 'application/json',
|
||||
// // 'x-appwrite-project' => '', disabled
|
||||
// ], $this->getHeaders())
|
||||
// );
|
||||
// $this->assertEquals(400, $response['headers']['status-code']);
|
||||
// $this->assertEquals('Please check X-Appwrite-Project header', $response['body']['message']);
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user