mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Merge pull request #11967 from appwrite/fix/listrows-total-int-cast
fix: cast cached total to int in listDocuments/listRows
This commit is contained in:
+1
-1
@@ -182,7 +182,7 @@ class XList extends Action
|
||||
$cachedTotal = null;
|
||||
}
|
||||
if ($cachedTotal !== null && $cachedTotal !== false) {
|
||||
$total = $cachedTotal;
|
||||
$total = (int) $cachedTotal;
|
||||
} else {
|
||||
$total = $dbForDatabases->count($collectionTableId, $queries, APP_LIMIT_COUNT);
|
||||
try {
|
||||
|
||||
@@ -3368,7 +3368,7 @@ trait DatabasesBase
|
||||
]);
|
||||
|
||||
$this->assertEquals(200, $documents2['headers']['status-code']);
|
||||
$this->assertEquals(3, $documents2['body']['total']);
|
||||
$this->assertSame(3, $documents2['body']['total']);
|
||||
$this->assertCount(3, $documents2['body'][$this->getRecordResource()]);
|
||||
$this->assertEquals($documents1['body'][$this->getRecordResource()][0]['$id'], $documents2['body'][$this->getRecordResource()][0]['$id']);
|
||||
$this->assertEquals($documents1['body'][$this->getRecordResource()][0]['title'], $documents2['body'][$this->getRecordResource()][0]['title']);
|
||||
|
||||
Reference in New Issue
Block a user