Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

fix: PHPUnit drift in SettingsControllerTest and 5 PHPCS errors#295

Merged
rubenvdlinde merged 1 commit into
developmentfrom
fix/phpunit-settingscontrollertest-and-phpcs
May 27, 2026
Merged

fix: PHPUnit drift in SettingsControllerTest and 5 PHPCS errors#295
rubenvdlinde merged 1 commit into
developmentfrom
fix/phpunit-settingscontrollertest-and-phpcs

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Summary

  • PHPUnit fix: SettingsControllerTest::setUp() passed a groupManager: named argument that no longer exists in SettingsController::__construct(). The controller was refactored to use #[AuthorizedAdminSetting] for admin enforcement, removing IGroupManager from the constructor. Updated the test to match the current 3-arg signature and removed 4 tests that asserted controller-level admin checks now handled by the framework attribute. 176 tests, 0 errors, 37 skipped (environment-dependent).
  • PHPCS fix: 5 errors across 4 files resolved:
    • lib/Mcp/DecideskToolProvider.php: 3× "Inline IF statements not allowed" — rewritten as multi-line if/else blocks
    • lib/Controller/VotingBehaviourController.php: alignment error — auto-fixed via phpcbf
    • lib/Service/WorkspaceService.php: trailing blank line after function — auto-fixed via phpcbf

Test plan

  • composer test:unit → 176 tests, 0 errors, 37 skipped
  • composer phpcs → 0 errors (1 pre-existing warning on PreferencesController, out of scope)

… fix PHPCS errors

SettingsController was refactored to use #[AuthorizedAdminSetting] for admin
enforcement (removing IGroupManager from the constructor), but SettingsControllerTest
still passed a groupManager named arg that no longer exists, causing 7 setUp errors.
Update the test to match the current constructor signature and remove tests for
controller-level admin checks that are now handled by the framework attribute.

Also fix 5 PHPCS errors: rewrite 3 inline ternary IFs in DecideskToolProvider as
multi-line if/else blocks, auto-fix alignment in VotingBehaviourController, and
remove a trailing blank line in WorkspaceService.
@rubenvdlinde rubenvdlinde merged commit 7887bce into development May 27, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant