mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Formatting
This commit is contained in:
@@ -1884,7 +1884,7 @@ App::post('/v1/databases/:databaseId/collections/:collectionId/documents')
|
||||
|
||||
$collection = Authorization::skip(fn() => $dbForProject->getDocument('database_' . $database->getInternalId(), $collectionId));
|
||||
|
||||
|
||||
|
||||
if ($collection->isEmpty() || !$collection->getAttribute('enabled')) {
|
||||
if (!($mode === APP_MODE_ADMIN && Auth::isPrivilegedUser(Authorization::getRoles()))) {
|
||||
throw new Exception(Exception::COLLECTION_NOT_FOUND);
|
||||
|
||||
+3
-2
@@ -510,8 +510,9 @@ $register->set('dbPool', function () {
|
||||
$dbPass = App::getEnv('_APP_DB_PASS', '');
|
||||
$dbScheme = App::getEnv('_APP_DB_SCHEMA', '');
|
||||
|
||||
$pool = new ConnectionPool(constructor: fn () =>
|
||||
new Client($dbScheme, $dbHost, (int) $dbPort, $dbUser, $dbPass, true),
|
||||
$pool = new ConnectionPool(
|
||||
constructor: fn () =>
|
||||
new Client($dbScheme, $dbHost, (int) $dbPort, $dbUser, $dbPass, true),
|
||||
size: 64
|
||||
);
|
||||
|
||||
|
||||
@@ -1183,7 +1183,7 @@ trait DatabasesBase
|
||||
]);
|
||||
|
||||
// var_dump($documents);
|
||||
|
||||
|
||||
$this->assertEquals(200, $documents['headers']['status-code']);
|
||||
$this->assertEquals($base['body']['documents'][2]['$id'], $documents['body']['documents'][0]['$id']);
|
||||
$this->assertCount(1, $documents['body']['documents']);
|
||||
|
||||
@@ -81,7 +81,7 @@ class DatabasesCustomClientTest extends Scope
|
||||
Permission::write(Role::user($this->getUser()['$id'])),
|
||||
]
|
||||
]);
|
||||
|
||||
|
||||
sleep(1);
|
||||
|
||||
// var_dump("\n###################\n");
|
||||
@@ -111,7 +111,7 @@ class DatabasesCustomClientTest extends Scope
|
||||
]);
|
||||
|
||||
sleep(1);
|
||||
|
||||
|
||||
$this->assertEquals(400, $document2['headers']['status-code']);
|
||||
}
|
||||
|
||||
|
||||
@@ -492,7 +492,7 @@ class DatabasesCustomServerTest extends Scope
|
||||
|
||||
$this->assertTrue(in_array('Test 1', $names));
|
||||
$this->assertTrue(in_array('Test 2', $names));
|
||||
|
||||
|
||||
$collections = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
@@ -1149,7 +1149,7 @@ class DatabasesCustomServerTest extends Scope
|
||||
]);
|
||||
|
||||
sleep(1);
|
||||
|
||||
|
||||
// $this->assertEquals(400, $tooWide['headers']['status-code']);
|
||||
// $this->assertEquals('Attribute limit exceeded', $tooWide['body']['message']);
|
||||
}
|
||||
@@ -1166,7 +1166,7 @@ class DatabasesCustomServerTest extends Scope
|
||||
]);
|
||||
|
||||
sleep(1);
|
||||
|
||||
|
||||
$this->assertEquals(201, $database['headers']['status-code']);
|
||||
$this->assertEquals('invalidDocumentDatabase', $database['body']['name']);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user