From addd140925b7b11ff3b5977ba7bdf590533bfb3b Mon Sep 17 00:00:00 2001 From: ArnabChatterjee20k Date: Fri, 12 Sep 2025 11:24:19 +0530 Subject: [PATCH] updated composer --- composer.json | 2 +- composer.lock | 27 +++++++------------ .../Databases/Legacy/DatabasesBase.php | 13 ++++++++- .../Databases/TablesDB/DatabasesBase.php | 13 ++++++++- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/composer.json b/composer.json index f6ad742915..1dc7288441 100644 --- a/composer.json +++ b/composer.json @@ -52,7 +52,7 @@ "utopia-php/cache": "0.13.*", "utopia-php/cli": "0.15.*", "utopia-php/config": "0.2.*", - "utopia-php/database": "dev-spatial-filter as 1.4.9", + "utopia-php/database": "1.*", "utopia-php/detector": "0.1.*", "utopia-php/domains": "0.8.*", "utopia-php/dns": "0.3.*", diff --git a/composer.lock b/composer.lock index fc067e8367..e454de0313 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5c861fd3b9ba28caced612134ab9e51c", + "content-hash": "7553e976312b0423cc31544abb91caec", "packages": [ { "name": "adhocore/jwt", @@ -3638,16 +3638,16 @@ }, { "name": "utopia-php/database", - "version": "dev-spatial-filter", + "version": "1.4.8", "source": { "type": "git", "url": "https://github.com/utopia-php/database.git", - "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b" + "reference": "dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/utopia-php/database/zipball/753800f9eb16bfd62b9647a0c54f39675dde728b", - "reference": "753800f9eb16bfd62b9647a0c54f39675dde728b", + "url": "https://api.github.com/repos/utopia-php/database/zipball/dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a", + "reference": "dbecdf89fde33a5f81ec19f4f97fe0c3715dc83a", "shasum": "" }, "require": { @@ -3688,9 +3688,9 @@ ], "support": { "issues": "https://github.com/utopia-php/database/issues", - "source": "https://github.com/utopia-php/database/tree/spatial-filter" + "source": "https://github.com/utopia-php/database/tree/1.4.8" }, - "time": "2025-09-11T15:21:57+00:00" + "time": "2025-09-12T03:35:59+00:00" }, { "name": "utopia-php/detector", @@ -8510,18 +8510,9 @@ "time": "2024-03-07T20:33:40+00:00" } ], - "aliases": [ - { - "package": "utopia-php/database", - "version": "dev-spatial-filter", - "alias": "1.4.9", - "alias_normalized": "1.4.9.0" - } - ], + "aliases": [], "minimum-stability": "stable", - "stability-flags": { - "utopia-php/database": 20 - }, + "stability-flags": {}, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php index a75d52fc4f..8d27aa7230 100644 --- a/tests/e2e/Services/Databases/Legacy/DatabasesBase.php +++ b/tests/e2e/Services/Databases/Legacy/DatabasesBase.php @@ -6693,7 +6693,7 @@ trait DatabasesBase '$id' => 'doc1', 'name' => 'Test Document 1', 'pointAttr' => [6.0, 6.0], - 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] ], [ @@ -6764,6 +6764,17 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['documents']); + // Test 4.1: contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['documents']); + $this->assertEquals('doc1', $response['body']['documents'][0]['$id']); + // Test 4.2: notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/databases/' . $databaseId . '/collections/' . $collectionId . '/documents', array_merge([ diff --git a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php index 3681a535ae..eba7ec96a7 100644 --- a/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php +++ b/tests/e2e/Services/Databases/TablesDB/DatabasesBase.php @@ -8158,7 +8158,7 @@ trait DatabasesBase '$id' => 'row1', 'name' => 'Test Row 1', 'pointAttr' => [6.0, 6.0], - 'lineAttr' => [[1.0, 1.0], [2.0, 2.0]], + 'lineAttr' => [[1.0, 1.0], [1.1,1.1] , [2.0, 2.0]], 'polyAttr' => [[[0.0, 0.0], [10.0, 0.0], [10.0, 10.0], [0.0, 10.0], [0.0, 0.0]]] ], [ @@ -8225,6 +8225,17 @@ trait DatabasesBase $this->assertEquals(200, $response['headers']['status-code']); $this->assertCount(2, $response['body']['rows']); + // contains on line (point on line) + $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ + 'content-type' => 'application/json', + 'x-appwrite-project' => $this->getProject()['$id'], + ], $this->getHeaders()), [ + 'queries' => [Query::contains('lineAttr', [[1.1, 1.1]])->toString()] + ]); + $this->assertEquals(200, $response['headers']['status-code']); + $this->assertCount(1, $response['body']['rows']); + $this->assertEquals('row1', $response['body']['rows'][0]['$id']); + // notContains on polygon (point outside all polygons) $response = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $tableId . '/rows', array_merge([ 'content-type' => 'application/json',