Skip to content

tests: rewrite stale unit tests skipped by PR #250 #253

Description

@rubenvdlinde

Context

PR #250 unblocked PHPUnit CI by marking three unit-test files skipped — the classes under test have all been refactored since the tests were written, so the existing test expectations no longer match the production code paths.

Files

  • tests/Unit/EventListener/SoftwareCatalogEventListenerTest.phpSoftwareCatalogEventListener::handle() now dispatches via handleObjectCreated / handleObjectUpdated / handleObjectDeleted private methods, each resolving schema IDs via SettingsService and then calling the appropriate service method. Tests still assert the old handleNewContact / handleNewGebruiker / etc. direct service calls.
  • tests/Unit/OrganisationUserWorkflowTest.phpContactpersonenController's dependency surface has grown (additional collaborators) and ContactPersonHandler now has findByUuid and other methods the tests' mocks don't declare.
  • tests/Unit/Service/ContactPersonHandlerTest.phpaddUserToGroupWithCheck etc. now call IUserManager::get twice (lookup + verify) and the dependency surface includes new collaborators.

Re-do scope

For each file:

  1. Read the current production code carefully.
  2. Inventory current public methods + collaborators.
  3. Rewrite tests against the new dispatch flow / call sequencing.
  4. Remove the markTestSkipped shim from setUp.

Aim for the same coverage intent as the original tests (event routing, contact-conversion workflow, user-group membership management).

Tracked per user feedback rule 'Always file issues for deferred work'.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions