Skip to content

test(versioniq): cover api controller guards and request validation - #667

Merged
rubenvdlinde merged 1 commit into
developmentfrom
quality/test-coverage-60c2c265-1
Nov 13, 2026
Merged

rubenvdlinde merged 1 commit into
developmentfrom
quality/test-coverage-60c2c265-1

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Unit tests for lib/Controller/ApiController.php.

  • ApiNonAdminRefusalTest (62 tests, 31 endpoints × 2): a signed-in non-admin and an anonymous caller both get 403 {"message": "Forbidden"} from every endpoint, and the installer, cache, PAT mapper/manager, deeplink builder, discovery, pin, policy, app manager and audit collaborators are never called
  • ApiRequestValidationTest (19 tests): sources(), getBinding() bound/unbound, blank and trimmed trusted-pattern removal, invalid trusted pattern → 422, appVersions() source trimming and status passthrough/fallback, discover() query bounds, PAT deeplinks (forge token, unknown kind → 400), cache summary/clear, missing PAT → 404 on patch and delete, unreadable installed version on pins() and pinApp()

81 new tests, strict coverage metadata (@covers / @uses); each new file was checked to fail when a subject line is broken.

Suite (tests/phpunit-unit-only.xml): before 1356 tests, 2 failures; after 1437 tests, the same 2 failures (inherited golden tests in Service/Installer).

Tests only; no production code changed.


Generated by Claude Code

Adds unit tests asserting every ApiController endpoint refuses non-admin
and anonymous callers without touching a collaborator, and tests for the
admin-side request handling branches that were not exercised yet.

Assisted-by: ClaudeCode:claude-opus-5-5
@rubenvdlinde
rubenvdlinde merged commit d434dca into development Nov 13, 2026
7 of 9 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/versioniq @ e17905d

Check PHP Vue Security License Tests
lint ✅
phpcs ✅
phpmd ✅
psalm ✅
phpstan ✅
phpmetrics ✅
eslint ✅
stylelint ✅
build ✅
composer ✅ ✅ 32/32
npm ✅ ✅ 302/302
app:check-code ⏭️
info.xml ✅
REUSE ❌
lockfile sync ✅
PHPUnit ✅ 1412/1412 · 25 skipped (8 legs)
Newman ⏭️
Playwright ⏭️ deferred: E2E runs locally and on the promotion path only. This pull request targets development, so the suite is asked once per promotion into beta and main rather than once per push per open pull request. Run it locally with npx playwright test, or from the Actions tab on a branch with no open pull request into development.
Hydra gates ✅

Quality workflow — 2026-11-15 05:34 UTC

Download the full PDF report from the workflow artifacts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant