refactor: remove debug output and enhance collection creation test with eventual assertion

This commit is contained in:
ArnabChatterjee20k
2026-03-11 16:52:11 +05:30
parent 3096404db5
commit 64dc730a3b
2 changed files with 15 additions and 13 deletions
@@ -116,7 +116,6 @@ class Create extends CollectionAction
}
/** @var Database $dbForDatabases */
$dbForDatabases = $getDatabasesDB($database);
var_dump($database->getArrayCopy());
$attributes = [];
$indexes = [];
@@ -2698,19 +2698,22 @@ trait MigrationsBase
$this->assertEquals(201, $database['headers']['status-code']);
$databaseId = $database['body']['$id'];
$collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'collectionId' => ID::unique(),
'name' => 'Vector CSV Export Collection',
'dimension' => 3,
'documentSecurity' => true,
]);
$collectionId = null;
$this->assertEventually(function () use ($databaseId, &$collectionId) {
$collection = $this->client->call(Client::METHOD_POST, '/vectorsdb/' . $databaseId . '/collections', [
'content-type' => 'application/json',
'x-appwrite-project' => $this->getProject()['$id'],
'x-appwrite-key' => $this->getProject()['apiKey'],
], [
'collectionId' => ID::unique(),
'name' => 'Vector CSV Export Collection',
'dimension' => 3,
'documentSecurity' => true,
]);
$this->assertEquals(201, $collection['headers']['status-code']);
$collectionId = $collection['body']['$id'];
$this->assertEquals(201, $collection['headers']['status-code']);
$collectionId = $collection['body']['$id'];
});
$documentsPayload = [
[