This repository was archived by the owner on May 29, 2026. It is now read-only.
[8/8] fix(tests): stabilise 11 PHPUnit failures + ProductionVersionGuardListener runtime bug#65
Merged
Conversation
…reateFromTemplate CreateFromTemplateTest (6 errors): pre-existing test from templates-marketplace; updated to match current controller surface. ApplicationCreationServiceTest + ApplicationCreationControllerTest (1 error + 2 failures): spec F tests needed setUp refactor (PHPUnit 10 disallows re-stubbing once-stubbed mock methods); introduced an authenticateAsAdmin() helper that each authenticated test calls explicitly. ManifestResolverServiceTest (3 failures): spec E test fixtures lacked uuid on the application object and 'application' relation on the version object; findVersionBySlug short-circuits when these are missing. Fixed fixtures. PHPUnit: 180/180 pass (was 169/180). composer check:strict, npm run lint, vitest 487/487, hydra 14/14 all green.
ProductionVersionGuardListener crashed on every OR ObjectUpdatingEvent (pipelinq seeding tripped over it during 'occ maintenance:repair' with 'Call to undefined method ObjectUpdatingEvent::getObject()'). Real OR signatures (verified against openregister/lib/Event/): - ObjectCreatingEvent::getObject(): ObjectEntity - ObjectUpdatingEvent::getNewObject(): ObjectEntity Spec C's listener and its stub both used getObject() for both — fixed to branch on event type and updated the stub class to match the real OR constructor signature (newObject + optional oldObject).
This was referenced May 16, 2026
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Top of the stack. Two unrelated fixes that surfaced after the chain was implemented:
PHPUnit stabilisation (11 failures → 0)
Spec agents ran `composer check:strict` but that doesn't include PHPUnit in this repo; some tests were broken by the chain's stub additions / setUp refactors and shipped red. This PR fixes them all:
ProductionVersionGuardListener runtime fix (CRITICAL)
Spec C's listener called `$event->getObject()` on both `ObjectCreatingEvent` AND `ObjectUpdatingEvent` — but the real OR API only exposes `getObject()` on Creating; Updating uses `getNewObject()`. This crashed every OR object update across the entire Nextcloud instance (pipelinq seeding tripped first during `occ maintenance:repair`).
Fix: branch on event type and call the correct method; stub class updated to match the real constructor signature (`newObject, ?oldObject`).
Test plan
Bugs surfaced during visual smoke (filed separately)
These are all integration glitches at the edges of the chain — none invalidate the chain's design. See morning report file for details.
🤖 Generated with Claude Code