mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
add tests
This commit is contained in:
Generated
+10
-10
@@ -3799,12 +3799,12 @@
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/utopia-php/database.git",
|
||||
"reference": "eb863401e90b4fcf84ca02c92675db3c30b331a3"
|
||||
"reference": "ba6763fad1e9be986c0e31ffe344a65298b62468"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/eb863401e90b4fcf84ca02c92675db3c30b331a3",
|
||||
"reference": "eb863401e90b4fcf84ca02c92675db3c30b331a3",
|
||||
"url": "https://api.github.com/repos/utopia-php/database/zipball/ba6763fad1e9be986c0e31ffe344a65298b62468",
|
||||
"reference": "ba6763fad1e9be986c0e31ffe344a65298b62468",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3849,7 +3849,7 @@
|
||||
"issues": "https://github.com/utopia-php/database/issues",
|
||||
"source": "https://github.com/utopia-php/database/tree/joins8"
|
||||
},
|
||||
"time": "2026-02-11T08:31:25+00:00"
|
||||
"time": "2026-02-11T13:08:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "utopia-php/detector",
|
||||
@@ -5488,16 +5488,16 @@
|
||||
"packages-dev": [
|
||||
{
|
||||
"name": "appwrite/sdk-generator",
|
||||
"version": "1.8.27",
|
||||
"version": "1.8.28",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/appwrite/sdk-generator.git",
|
||||
"reference": "9c6927336a163954c0ed6d8208af8d5b83761762"
|
||||
"reference": "4762aa017b28a3a7e4e53da6e193d0c196ec3fd4"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/9c6927336a163954c0ed6d8208af8d5b83761762",
|
||||
"reference": "9c6927336a163954c0ed6d8208af8d5b83761762",
|
||||
"url": "https://api.github.com/repos/appwrite/sdk-generator/zipball/4762aa017b28a3a7e4e53da6e193d0c196ec3fd4",
|
||||
"reference": "4762aa017b28a3a7e4e53da6e193d0c196ec3fd4",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -5533,9 +5533,9 @@
|
||||
"description": "Appwrite PHP library for generating API SDKs for multiple programming languages and platforms",
|
||||
"support": {
|
||||
"issues": "https://github.com/appwrite/sdk-generator/issues",
|
||||
"source": "https://github.com/appwrite/sdk-generator/tree/1.8.27"
|
||||
"source": "https://github.com/appwrite/sdk-generator/tree/1.8.28"
|
||||
},
|
||||
"time": "2026-02-10T06:10:29+00:00"
|
||||
"time": "2026-02-11T10:35:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
|
||||
@@ -146,6 +146,7 @@ class XList extends Action
|
||||
// has selects, allow relationship on documents
|
||||
$documents = $dbForProject->find($collectionTableId, $queries);
|
||||
$total = $includeTotal ? $dbForProject->count($collectionTableId, $queries, APP_LIMIT_COUNT) : 0;
|
||||
var_dump($documents);
|
||||
} else {
|
||||
// has no selects, disable relationship loading on documents
|
||||
/* @type Document[] $documents */
|
||||
|
||||
@@ -183,7 +183,9 @@ class DatabasesConsoleClientTest extends Scope
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'queries' => [
|
||||
Query::join($sessions['body']['$id'], 'B', [Query::relationEqual('', '$sequence','B', 'userId')])->toString(),
|
||||
Query::join($sessions['body']['$id'], 'B', [
|
||||
Query::relationEqual('', '$sequence','B', 'userId')
|
||||
])->toString(),
|
||||
Query::orderDesc('username', '')->toString(),
|
||||
],
|
||||
]);
|
||||
@@ -209,12 +211,13 @@ class DatabasesConsoleClientTest extends Scope
|
||||
'queries' => [
|
||||
Query::select('username', '')->toString(),
|
||||
Query::select('userId', 'B')->toString(),
|
||||
Query::join($sessions['body']['$id'], 'B', [Query::relationEqual('', '$sequence','B', 'userId')])->toString(),
|
||||
Query::join($sessions['body']['$id'], 'B', [
|
||||
Query::relationEqual('', '$sequence','B', 'userId')
|
||||
])->toString(),
|
||||
Query::orderDesc('username', '')->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
var_dump($rows);
|
||||
$this->assertEquals(2, $rows['body']['total']);
|
||||
$this->assertEquals('Bill', $rows['body']['rows'][0]['username']);
|
||||
$this->assertEquals('Abraham', $rows['body']['rows'][1]['username']);
|
||||
@@ -227,6 +230,25 @@ class DatabasesConsoleClientTest extends Scope
|
||||
$this->assertArrayNotHasKey('$updatedAt', $rows['body']['rows'][0]);
|
||||
$this->assertArrayNotHasKey('$permissions', $rows['body']['rows'][0]);
|
||||
|
||||
/**
|
||||
* Simple join query + equal query
|
||||
*/
|
||||
$rows = $this->client->call(Client::METHOD_GET, '/tablesdb/' . $databaseId . '/tables/' . $users['body']['$id'] . '/rows', array_merge([
|
||||
'content-type' => 'application/json',
|
||||
'x-appwrite-project' => $this->getProject()['$id'],
|
||||
], $this->getHeaders()), [
|
||||
'queries' => [
|
||||
Query::select('*', 'B')->toString(),
|
||||
Query::equal('userId', [$bill['body']['$sequence']], 'B')->toString(),
|
||||
Query::join($sessions['body']['$id'], 'B', [
|
||||
Query::relationEqual('', '$sequence','B', 'userId')
|
||||
])->toString(),
|
||||
],
|
||||
]);
|
||||
|
||||
$this->assertEquals(1, $rows['body']['total']);
|
||||
$this->assertEquals($bill['body']['$sequence'], $rows['body']['rows'][0]['userId']);
|
||||
$this->assertArrayNotHasKey('username', $rows['body']['rows'][0]);
|
||||
|
||||
$this->assertEquals('shmuel', 'fogel');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user