Skip to content

Commit 1ed4f74

Browse files
authored
Merge pull request #58892 from nextcloud/chore/add-test-snowflake-32
2 parents 3f6d0c4 + 1b24138 commit 1ed4f74

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/workflows/phpunit-32bits.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- ".github/workflows/phpunit-32bits.yml"
1010
- "tests/phpunit-autotest.xml"
1111
- "lib/private/Snowflake/*"
12+
- "tests/lib/Preview/PreviewMapperTest.php"
1213
workflow_dispatch:
1314
schedule:
1415
- cron: "15 1 * * 1-6"

tests/lib/Preview/PreviewMapperTest.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testGetAvailablePreviews(): void {
6464
$this->assertEquals('default', $previews[43][0]->getObjectStoreName());
6565
}
6666

67-
private function createPreviewForFileId(int $fileId, ?int $bucket = null): void {
67+
private function createPreviewForFileId(int $fileId, ?int $bucket = null): string {
6868
$locationId = null;
6969
if ($bucket) {
7070
$qb = $this->connection->getQueryBuilder();
@@ -95,5 +95,16 @@ private function createPreviewForFileId(int $fileId, ?int $bucket = null): void
9595
$preview->setLocationId($locationId);
9696
}
9797
$this->previewMapper->insert($preview);
98+
99+
return $preview->id;
100+
}
101+
102+
public function testLargeIdInsertRetrieve(): void {
103+
$fileId = PHP_INT_MAX;
104+
$originalPreviewId = $this->createPreviewForFileId($fileId);
105+
106+
$dbPreview = $this->previewMapper->getAvailablePreviews([$fileId])[$fileId][0];
107+
$this->assertEquals($originalPreviewId, $dbPreview->id);
108+
$this->assertEquals($fileId, $dbPreview->getFileId());
98109
}
99110
}

0 commit comments

Comments
 (0)