Repository navigation
test(versioniq): cover the audit and PAT mappers - #670
Merged
Merged
Conversation
Adds unit tests for the queries AuditEntryMapper and PatMapper build, using a recording query builder double, and for Pat::toRedacted(). The unit-only bootstrap stubs gain Doctrine's Types and ExpressionBuilder constant classes: without them no test double of IQueryBuilder or IExpressionBuilder can be created outside a server checkout. Assisted-by: ClaudeCode:claude-opus-5-5
Contributor
Quality Report — ConductionNL/versioniq @
|
| 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 | ❌ 1338/1348 · 25 skipped (worst of 8 legs: PHP 8.3, NC stable32, pgsql) | ||||
| 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:43 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unit tests for lib/Db/.
AuditEntryMapperTest(5 tests): newest-first page with limit/offset, app filter only for a non-empty app id, batched oldest-first retention delete by id (PARAM_INT_ARRAY), nothing deleted when nothing is oldPatMapperTest(5 tests):findByIdbinds an integer id and throwsDoesNotExistExceptionwhen missing,findAllwithout filter,findVisibleTo= own OR shared-with-admins newest first,deleteByOwnerPatRedactionTest(7 tests):toRedacted()carries every public field and never the encrypted token or warning ledger; scope JSON decoded only when it is an array; empty ledger stringThe mappers are exercised through a recording
IQueryBuilderdouble, so the exact table, predicates, ordering, limits and bound parameter types are asserted; rows are mapped by the realQBMapper.Test support:
tests/stubs/server-internals.php(loaded only by the unit-only bootstrap) gainsDoctrine\DBAL\Types\TypesandDoctrine\DBAL\Query\Expression\ExpressionBuilderconstant stubs, next to the existingParameterTypeones. Without them no double ofIQueryBuilder/IExpressionBuildercan be created outside a server checkout, which is why the mappers had no unit tests.Coverage: AuditEntryMapper 0% → 100%, PatMapper 0% → 100%. 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 1373 tests, the same 2 failures (inherited golden tests in Service/Installer).
Tests only; no production code changed.
Generated by Claude Code