mirror of
https://github.com/nextcloud/server.git
synced 2026-06-08 16:26:59 -04:00
chore(tests): check Snowflake ID preserved in 32 bits
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
This commit is contained in:
parent
92e4c882fc
commit
71aa36860f
1 changed files with 12 additions and 1 deletions
|
|
@ -64,7 +64,7 @@ class PreviewMapperTest extends TestCase {
|
|||
$this->assertEquals('default', $previews[43][0]->getObjectStoreName());
|
||||
}
|
||||
|
||||
private function createPreviewForFileId(int $fileId, ?int $bucket = null): void {
|
||||
private function createPreviewForFileId(int $fileId, ?int $bucket = null): string {
|
||||
$locationId = null;
|
||||
if ($bucket) {
|
||||
$qb = $this->connection->getQueryBuilder();
|
||||
|
|
@ -95,5 +95,16 @@ class PreviewMapperTest extends TestCase {
|
|||
$preview->setLocationId($locationId);
|
||||
}
|
||||
$this->previewMapper->insert($preview);
|
||||
|
||||
return $preview->id;
|
||||
}
|
||||
|
||||
public function testLargeIdInsertRetrieve(): void {
|
||||
$fileId = PHP_INT_MAX;
|
||||
$originalPreviewId = $this->createPreviewForFileId($fileId);
|
||||
|
||||
$dbPreview = $this->previewMapper->getAvailablePreviews([$fileId])[$fileId][0];
|
||||
$this->assertEquals($originalPreviewId, $dbPreview->id);
|
||||
$this->assertEquals($fileId, $dbPreview->getFileId());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue