From 2f8bf973f2ed322b091d585f57f2d8af53e5804b Mon Sep 17 00:00:00 2001 From: wess Date: Wed, 16 Nov 2022 11:32:37 -0500 Subject: [PATCH] Formatting --- app/controllers/api/databases.php | 2 +- app/init.php | 5 +++-- tests/e2e/Services/Databases/DatabasesBase.php | 2 +- tests/e2e/Services/Databases/DatabasesCustomClientTest.php | 4 ++-- tests/e2e/Services/Databases/DatabasesCustomServerTest.php | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index 5c853ee5b5..d1f195b8f0 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -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); diff --git a/app/init.php b/app/init.php index 14f7a4d5e9..50ddbe537c 100644 --- a/app/init.php +++ b/app/init.php @@ -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 ); diff --git a/tests/e2e/Services/Databases/DatabasesBase.php b/tests/e2e/Services/Databases/DatabasesBase.php index 70eaa22f53..98f98fd9a3 100644 --- a/tests/e2e/Services/Databases/DatabasesBase.php +++ b/tests/e2e/Services/Databases/DatabasesBase.php @@ -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']); diff --git a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php index bacddd1481..0c80dc7d87 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomClientTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomClientTest.php @@ -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']); } diff --git a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php index 8f73dd7a42..eeb78dffb8 100644 --- a/tests/e2e/Services/Databases/DatabasesCustomServerTest.php +++ b/tests/e2e/Services/Databases/DatabasesCustomServerTest.php @@ -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']);