Skip to content

[access] test(gdpr): cover GdprEntityMapper lookups and OrganisationScopeTable - #7588

Merged
rubenvdlinde merged 1 commit into
mainfrom
cloud/t01-gdpr-scope
Nov 9, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
cloud/t01-gdpr-scope

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

What

New behaviour test (no production code touched) for two scope files below 85%:

  • GdprEntityMapper — find() binds the id as an integer and throws on a miss; findEntitiesPublic() hydrates every row
  • MagicMapper\OrganisationScopeTable — named exactly when it carries a register or a schema

Measured (subset run, lower bound of full suite)

php -d pcov.enabled=1 -d pcov.directory=lib vendor/bin/phpunit -c phpunit.xml --coverage-clover /tmp/t01-sub.xml tests/Unit/Db/GdprEntityMapperAndScopeTableBehaviourTest.php + clover_files.py

File before (CI) after
lib/Db/GdprEntityMapper.php 31/37 37/37 together with the existing tests (the 6 lines this PR adds: find, findEntitiesPublic)
lib/Db/MagicMapper/OrganisationScopeTable.php 1/2 2/2

Finding: lib/Db/AuthorizationRulesTrait.php:50-52 (the catch around json_decode) is unreachable — json_decode without JSON_THROW_ON_ERROR never throws — so that file stays at 8/10.

phpcs clean. weak.php reports none of the new tests.

Mutation samples (each reverted, never committed)

  • mutation: lib/Db/MagicMapper/OrganisationScopeTable.php isNamed() || changed to && -> 1 test failed
  • mutation: lib/Db/GdprEntityMapper.php find() bound the id as a string -> 1 test failed

Tests written with Claude Code.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde changed the base branch from development to main November 9, 2026 06:53

Copy link
Copy Markdown
Contributor Author

Newman API Test Suite (api-test-coverage) is red, but the failures do not come from this PR.

The job runs the full PHPUnit suite and ends with 11 errors and 11 failures. All of them are in tests this PR does not touch:

  • JobRunMapperNarrowGoldenTest
  • FileVersioningHandlerGoldenTest
  • A18InterfaceBindingsTest
  • TextExtractionJobsGoldenTest
  • EndpointsControllerAnswersGoldenTest
  • SchemaConfigValidatorsGoldenTest
  • ProcessingLogServiceGoldenTest

GdprEntityMapperAndScopeTableBehaviourTest passes.

The same 22 tests fail on development, including a1fd993 (the commit this branch was cut from), and on #7526, #7549, #7576 and #7586.

This PR only adds a test file, so there is nothing to fix here and no fix exists yet to port in. I have not re-run the check, because development fails the same way.


Generated by Claude Code

Copy link
Copy Markdown
Contributor Author

Frontend Check (test:l10n) is red, but the cause is on development, not in this PR. It fails because source strings used in src/ are missing from l10n/en.js. The repo's CLAUDE.md already lists that gate as red at HEAD under "Known state". This PR adds one PHP test file and touches nothing under l10n/ or src/.

The rest of the quality job is expected to fail here the same way it did on #7526, #7549, #7576 and #7586. Each failure comes from existing code that this PR doesn't touch:

  • test:l10n:parity: l10n/de.js is missing "We could not count the objects. Close this window and try again.". That key is missing on development too.
  • format and eslint: the flagged files are existing ones under src/.
  • Frontend Tests (unit): src/views/migrationPack/migrationPackTables.dom.golden.spec.js fails to parse in jest. Every test that runs passes.
  • phpcs, phpstan, psalm, phpmd: all findings are in production code under lib/, none in tests/.
  • Hydra Gates: the same 7 gates fail, from a full-repo scan.

A test-only PR can't fix any of these. Each needs its own fix on development.


Generated by Claude Code

@rubenvdlinde
rubenvdlinde merged commit 4e72229 into main Nov 9, 2026
37 of 49 checks passed
@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

Quality Report — ConductionNL/openregister @ af7d317

Check PHP Vue Security License Tests
lint ✅
phpcs ❌
phpmd ❌
psalm ❌
phpstan ❌
phpmetrics ✅
eslint ❌
stylelint ✅
build ✅
check-specs ✅
test-l10n ❌
test-l10n-parity ❌
format ❌
check-schema-l10n ✅
test-coverage-ratchet ✅
composer ✅ ✅ 168/168
npm ✅ ✅ 641/641
app:check-code ⏭️
info.xml ✅
REUSE ✅
lockfile sync ✅
PHPUnit ❌ 49045/49055 · 19 skipped
Newman ❌ 1625/1628
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-09 17:40 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.

2 participants