diff --git a/.github/workflows/phpunit-32bits.yml b/.github/workflows/phpunit-32bits.yml index 85982e1ede354..fb6aa7bd4b474 100644 --- a/.github/workflows/phpunit-32bits.yml +++ b/.github/workflows/phpunit-32bits.yml @@ -9,6 +9,7 @@ on: - ".github/workflows/phpunit-32bits.yml" - "tests/phpunit-autotest.xml" - "lib/private/Snowflake/*" + - "tests/lib/Preview/PreviewMapperTest.php" workflow_dispatch: schedule: - cron: "15 1 * * 1-6" diff --git a/tests/lib/Preview/PreviewMapperTest.php b/tests/lib/Preview/PreviewMapperTest.php index b4a392b78f9f5..96f68ddf9eee9 100644 --- a/tests/lib/Preview/PreviewMapperTest.php +++ b/tests/lib/Preview/PreviewMapperTest.php @@ -64,7 +64,7 @@ public function testGetAvailablePreviews(): void { $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 @@ private function createPreviewForFileId(int $fileId, ?int $bucket = null): void $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()); } }