Summary
When the decidesk unit-test suite runs in an environment where OpenRegister is installed (e.g. the Nextcloud container or CI with the server bootstrapped), the real `OCA\OpenRegister\Service\ObjectService` class is loaded by Nextcloud's autoloader — bypassing the stub fallback in `tests/bootstrap*.php`.
The decidesk tests mock `saveObject`, `find`, `getObject`, and `findObjects` assuming the stub signature (`?array` returns). The real `ObjectService` has different return types (`ObjectEntity`) and, for `findObjects`, no method of that name at all.
Under PHPUnit 10 this surfaces as:
- `PHPUnit\Framework\MockObject\IncompatibleReturnValueException: Method saveObject may not return value of type array, its declared return type is `OCA\OpenRegister\Db\ObjectEntity``
- `PHPUnit\Framework\MockObject\MethodCannotBeConfiguredException: Trying to configure method `findObjects` which cannot be configured because it does not exist`
21 tests error out, blocking the Hydra pipeline builder on every spec.
Failing tests
- `tests/Unit/Controller/DecisionControllerTest`: 1 test
- `tests/Unit/Service/MeetingServiceTest`: 3 tests
- `tests/Unit/Service/MotionServiceTest`: 7 tests
- `tests/Unit/Service/VotingServiceTest`: 10 tests
Short-term workaround (this PR)
Mark the 21 affected tests with `markTestSkipped()` so the suite can run green in the container.
Proposed long-term fix
Pick one approach and apply it consistently:
- Align stubs to real `ObjectService` — update `tests/Stubs/Service/ObjectService.php` to mirror the real class's method list and return types (`saveObject(...): ObjectEntity`, `find(...): ?ObjectEntity`, no `findObjects`, use `searchObjectsPaginated` instead). Then update every test that sets return values to produce `ObjectEntity` mocks (or a simple stub implementing the required interface shape).
- Decouple tests from the real class — make the unit-test bootstrap actively unregister any autoloader that resolves `OCA\OpenRegister\Service\ObjectService` to the real class, then include the stub. This is fragile but preserves the current test style.
- Rewrite production code to depend on a thin adapter interface in the decidesk namespace rather than OpenRegister's `ObjectService` directly. The tests mock the adapter, not `ObjectService`. This is the cleanest but also the largest change.
Option 1 is recommended — align the stub with reality, then retrofit the tests.
Priority
High — same blast radius as pipelinq #286 (same class of pattern in a sibling repo).
Summary
When the decidesk unit-test suite runs in an environment where OpenRegister is installed (e.g. the Nextcloud container or CI with the server bootstrapped), the real `OCA\OpenRegister\Service\ObjectService` class is loaded by Nextcloud's autoloader — bypassing the stub fallback in `tests/bootstrap*.php`.
The decidesk tests mock `saveObject`, `find`, `getObject`, and `findObjects` assuming the stub signature (`?array` returns). The real `ObjectService` has different return types (`ObjectEntity`) and, for `findObjects`, no method of that name at all.
Under PHPUnit 10 this surfaces as:
21 tests error out, blocking the Hydra pipeline builder on every spec.
Failing tests
Short-term workaround (this PR)
Mark the 21 affected tests with `markTestSkipped()` so the suite can run green in the container.
Proposed long-term fix
Pick one approach and apply it consistently:
Option 1 is recommended — align the stub with reality, then retrofit the tests.
Priority
High — same blast radius as pipelinq #286 (same class of pattern in a sibling repo).