Skip to content

Commit 071a9b2

Browse files
authored
Merge pull request #5614 from LibreSign/fix/unit-test-at-php-gt-and-equals-to-8.4
fix: unit tests at PHP >= 8.4
2 parents ffcb7ff + 433d974 commit 071a9b2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

tests/php/Unit/Service/FileServiceTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ final class FileServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
5656
protected SignRequestMapper $signRequestMapper;
5757
protected FileElementMapper $fileElementMapper;
5858
protected FileElementService $fileElementService;
59-
protected FolderService|MockObject $folderService;
59+
protected FolderService $folderService;
6060
protected ValidateHelper $validateHelper;
6161
protected PdfParserService $pdfParserService;
6262
private AccountService&MockObject $accountService;
@@ -76,6 +76,9 @@ final class FileServiceTest extends \OCA\Libresign\Tests\Unit\TestCase {
7676
protected vfsDirectory $tempFolder;
7777

7878
public function setUp(): void {
79+
// Disable lazy objects to avoid PHP 8.4 dependency injection issues in tests
80+
\OC\AppFramework\Utility\SimpleContainer::$useLazyObjects = false;
81+
7982
$this->tempFolder = vfsStream::setup('uploaded');
8083
$appConfig = $this->getMockAppConfig();
8184
$appConfig->setValueInt(Application::APP_ID, 'length_of_page', 100);

0 commit comments

Comments
 (0)