Skip to content

test: adapt DirectDownloadServiceTest for DirectController dependency changes - #1133

Merged
saw-jan merged 2 commits into
masterfrom
fix/php-unit-test
Aug 5, 2026
Merged

test: adapt DirectDownloadServiceTest for DirectController dependency changes#1133
saw-jan merged 2 commits into
masterfrom
fix/php-unit-test

Conversation

@nabim777

@nabim777 nabim777 commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR updates DirectDownloadServiceTest to use the app container for DirectController instead of building it manually.

Issue

Due to the changes in the server PR (nextcloud/server#62809), a new constructor was added. Because of this, the following error occurs in the Psalm tests:

Error: tests/lib/Service/DirectDownloadServiceTest.php:64:29: TooFewArguments: Too few arguments for OCA\DAV\Controller\DirectController::__construct - expecting shareManager to be passed (see https://psalm.dev/025)

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Updated CHANGELOG.md file

@nabim777 nabim777 self-assigned this Aug 4, 2026
@nabim777
nabim777 force-pushed the fix/php-unit-test branch 2 times, most recently from 6d2cf9e to 51dbc91 Compare August 4, 2026 10:50
@nabim777 nabim777 changed the title test: add IManager dependency to DirectDownloadServiceTest test: adapt DirectDownloadServiceTest for DirectController dependency changes Aug 4, 2026
@nabim777
nabim777 force-pushed the fix/php-unit-test branch from 51dbc91 to 2d99bf9 Compare August 4, 2026 10:59
@nabim777
nabim777 marked this pull request as ready for review August 4, 2026 11:14
Comment thread tests/lib/Service/DirectDownloadServiceTest.php Outdated
@nabim777
nabim777 force-pushed the fix/php-unit-test branch from 2d99bf9 to 8878f55 Compare August 5, 2026 03:45
@nabim777
nabim777 requested a review from saw-jan August 5, 2026 03:45
@nabim777
nabim777 force-pushed the fix/php-unit-test branch from 8878f55 to 8733300 Compare August 5, 2026 03:48
Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
… changes

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
@nabim777
nabim777 force-pushed the fix/php-unit-test branch from 8733300 to 650a005 Compare August 5, 2026 03:52
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

PHP Code Coverage

Coverage after merging fix/php-unit-test into master will be
67.97%
Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
integration_openproject/server/apps/integration_openproject/lib
   Capabilities.php0%100%0%0%24, 31–40
   OIDCClientMapper.php0%100%0%0%29, 40–49, 52
   ServerVersion.php0%100%0%0%17, 27–29, 32, 41–42
   TokenEventFactory.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/AppInfo
   Application.php37.04%100%50%36%116–118, 121–135, 138, 140, 142–143, 146, 151–152, 156–159, 161–172, 174, 177, 181, 185–187, 220
integration_openproject/server/apps/integration_openproject/lib/BackgroundJob
   RemoveExpiredDirectUploadTokens.php0%100%0%0%28, 30–32, 41–42
integration_openproject/server/apps/integration_openproject/lib/Controller
   ConfigController.php79.16%100%70.59%79.51%114, 151–152, 154, 156–158, 160–163, 166–167, 169, 194, 198–200, 442–444, 446–448, 497, 577–581, 592, 606–609, 617, 621–624, 663, 669–684, 725, 728, 731–746, 760–763, 765–769
   DirectDownloadController.php0%100%0%0%33–35, 50–52, 54–61
   DirectUploadController.php71.03%100%100%70.21%117–119, 162–164, 175, 179–182, 184, 194, 201, 217–219, 221–222, 225–230, 233, 235, 245–247, 253–255, 263–265, 280–282, 301, 306, 312
   FilesController.php85.60%100%83.33%85.71%181–182, 244, 253, 270–273, 278–280, 285–287, 299, 301, 304
   OpenProjectAPIController.php81.09%100%82.35%80.98%116, 155, 202–204, 207–214, 216–220, 222, 241, 266, 331, 381, 401, 448, 473–475, 478–482, 484, 66
   OpenProjectController.php96.45%100%80%96.95%241–245
integration_openproject/server/apps/integration_openproject/lib/Dashboard
   OpenProjectWidget.php0%100%0%0%101, 108–109, 111–116, 118–122, 124–126, 129–140, 61–66, 73, 80, 87, 94
integration_openproject/server/apps/integration_openproject/lib/Exception
   OpenprojectAvatarErrorException.php100%100%100%100%
   OpenprojectErrorException.php100%100%100%100%
   OpenprojectFileNotUploadedException.php100%100%100%100%
   OpenprojectGroupfolderSetupConflictException.php100%100%100%100%
   OpenprojectResponseException.php100%100%100%100%
   OpenprojectUnauthorizedUserException.php0%100%0%0%21
integration_openproject/server/apps/integration_openproject/lib/Listener
   BeforeGroupDeletedListener.php100%100%100%100%
   BeforeNodeInsideOpenProjectGroupfilderChangedListener.php0%100%0%0%46–48, 52–55, 57, 59, 62–63, 65, 67–70, 72–75, 77–79
   BeforeUserDeletedListener.php40%100%50%37.50%30, 38, 42–43, 45
   LoadAdditionalScriptsListener.php0%100%0%0%37–38, 46–47, 49, 51–52, 54
   LoadSidebarScript.php65.91%100%100%64.29%105, 77–88, 95, 98
   OpenProjectReferenceListener.php0%100%0%0%45–47, 54–55, 57, 59–60, 62–74
   TermsOfServiceEventListener.php0%100%0%0%41–42, 47–48, 50–51, 53–55, 58–62
   UserChangedListener.php0%100%0%0%34, 41–42, 45–50, 53
   UserLoggedInEventListener.php0%100%0%0%27, 35–36, 39, 42
integration_openproject/server/apps/integration_openproject/lib/Migration
   Version2001Date20221213083550.php0%100%0%0%30, 40–48, 50–58, 60–62, 64
   Version20100Date20250820101358.php0%100%0%0%38, 47–53, 56
   Version2310Date20230116153411.php0%100%0%0%29, 32–35, 37–62, 64–65, 67
   Version2400Date20230504144300.php0%100%0%0%30, 40–43
   Version2640Date20240628114301.php0%100%0%0%35, 47–49, 52–53, 56
   Version2900Date20250718065820.php0%100%0%0%22, 33–36, 38–39, 41–42, 45
integration_openproject/server/apps/integration_openproject/lib/Reference
   WorkPackageReferenceProvider.php51.67%100%25%58.33%100–101, 104, 108, 142, 150–151, 159, 37, 44, 51, 58–60, 87, 93–96, 99
integration_openproject/server/apps/integration_openproject/lib/Search
   OpenProjectSearchProvider.php0%100%0%0%100–102, 104–106, 109–110, 112–113, 116–125, 127–131, 52–55, 62, 69, 77, 79, 82, 89–90, 93–97, 99
   OpenProjectSearchResultEntry.php100%100%100%100%
integration_openproject/server/apps/integration_openproject/lib/Service
   DatabaseService.php42.31%100%60%40.43%108–112, 114, 63–76, 78–85
   DirectDownloadService.php88.46%100%100%87.50%62–63, 65
   DirectUploadService.php42.86%100%66.67%40%101, 62–65, 67–75, 95
   OauthService.php0%100%0%0%100–101, 40–42, 51–58,

@saw-jan
saw-jan merged commit 6609b41 into master Aug 5, 2026
11 of 16 checks passed
@saw-jan
saw-jan deleted the fix/php-unit-test branch August 5, 2026 04:29
@nabim777

nabim777 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

/backport to release/3.1

@backportbot

backportbot Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

The backport to release/3.1 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout release/3.1
git pull origin release/3.1

# Create the new backport branch
git checkout -b backport/1133/release/3.1

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick e1381311 650a0055

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1133/release/3.1

Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress
fatal: cherry-pick failed


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@nabim777

nabim777 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

/backport 6609b41 to release/3.1

nabim777 added a commit that referenced this pull request Aug 5, 2026
… changes (#1133)

* test: add IManager dependency to DirectDownloadServiceTest

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

* test: adapt DirectDownloadServiceTest for DirectController dependency changes

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
@nabim777

nabim777 commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator Author

/backport 6609b41 to release/2.11

nabim777 added a commit that referenced this pull request Aug 5, 2026
… changes (#1133)

* test: add IManager dependency to DirectDownloadServiceTest

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

* test: adapt DirectDownloadServiceTest for DirectController dependency changes

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>

---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
saw-jan pushed a commit that referenced this pull request Aug 5, 2026
… changes (#1133) (#1134)

* test: add IManager dependency to DirectDownloadServiceTest



* test: adapt DirectDownloadServiceTest for DirectController dependency changes



---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Co-authored-by: Nalem7 <61624650+nabim777@users.noreply.github.com>
saw-jan pushed a commit that referenced this pull request Aug 5, 2026
… changes (#1133) (#1135)

* test: add IManager dependency to DirectDownloadServiceTest



* test: adapt DirectDownloadServiceTest for DirectController dependency changes



---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Co-authored-by: Nalem7 <61624650+nabim777@users.noreply.github.com>
@saw-jan

saw-jan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/backport to release/2.12

@backportbot

backportbot Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The backport to release/2.12 failed. Please do this backport manually.

# Switch to the target branch and update it
git checkout release/2.12
git pull origin release/2.12

# Create the new backport branch
git checkout -b backport/1133/release/2.12

# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts, resolve them
git cherry-pick e1381311 650a0055

# Push the cherry pick commit to the remote repository and open a pull request
git push origin backport/1133/release/2.12

Error: Failed to cherry pick commits: error: no cherry-pick or revert in progress
fatal: cherry-pick failed


Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@saw-jan

saw-jan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/backport 6609b41 to release/2.11

@saw-jan

saw-jan commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

/backport 6609b41 to release/2.12

saw-jan added a commit that referenced this pull request Aug 6, 2026
… changes (#1133) (#1138)

* test: add IManager dependency to DirectDownloadServiceTest



* test: adapt DirectDownloadServiceTest for DirectController dependency changes



---------

Signed-off-by: nabim777 <nabinalemagar019@gmail.com>
Co-authored-by: Nalem7 <61624650+nabim777@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants