fix(tests): load the ObjectCreatedEvent stub after Nextcloud boots - #1213
Merged
Merged
Conversation
The stub extends OCP\EventDispatcher\Event and sat one level under tests/Stubs, so the early stub glob in tests/bootstrap.php required it before lib/base.php made OCP resolvable. Every CI PHPUnit leg died in the bootstrap with Class "OCP\EventDispatcher\Event" not found before any test ran. Move it two levels deep, out of the glob's reach, and load it after the boot when OCP resolves and the real OpenRegister event does not.
Contributor
Quality Report — ConductionNL/stackiq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 130/130 | |||
| npm | ✅ | ✅ 807/807 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ | ||||
| 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-10-02 04:20 UTC
Download the full PDF report from the workflow artifacts.
… publication field rules With the bootstrap fixed, CI ran stackiq's unit tests for the first time in a while and found two merged PRs disagreeing: #1209's test said usage may have no public read rule, while #1206 gives usage a public rule conditional on publicationDate. Owners stay private either way: contactPerson has no public rule, the import never sets a usage's publicationDate, and usage.businessOwner, technicalOwner and contactPerson carry authenticated-only property rules. The test now pins exactly that, and fails if any of those person properties is made public (control run: businessOwner set to public fails it).
Contributor
Quality Report — ConductionNL/stackiq @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| check-manifest | ✅ | ||||
| check-vue-demi | ✅ | ||||
| test-l10n | ✅ | ||||
| format | ✅ | ||||
| check-schema-l10n | ✅ | ||||
| check-l10n-js | ✅ | ||||
| composer | ✅ | ✅ 130/130 | |||
| npm | ✅ | ✅ 807/807 | |||
| app:check-code | ⏭️ | ||||
| info.xml | ✅ | ||||
| REUSE | ❌ | ||||
| lockfile sync | ✅ | ||||
| PHPUnit | ❌ | ||||
| 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-10-02 04:37 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.
Every PHPUnit leg in Code Quality on
developmentdied intests/bootstrap.php:62withClass "OCP\EventDispatcher\Event" not foundbefore any test ran.Cause.
tests/Stubs/Event/ObjectCreatedEvent.php(added in #1197) extendsOCP\EventDispatcher\Event. The earlytests/Stubs/{,**/}*.phpglob reaches one level deep, so it required the stub beforelib/base.phphad run.nextcloud/ocpships no autoload section, so nothing could resolve OCP at that point.Fix. The stub moves to
tests/Stubs/OpenRegister/Event/, out of the glob's reach. It loads after the Nextcloud boot, and only when OCP resolves and the real OpenRegister event does not. This is the same pattern the Integriq event stubs already use.tests/bootstrap-unit.phppoints its PSR-4 map at the new path.Verified locally.
phpunit -c phpunit.xmlbefore the fix reproduces the CI bootstrap error. After the fix the bootstrap passes. On the host it then stops at test loading, because there is no Nextcloud tree and no OCP.phpunit -c phpunit-unit.xmlgives the same result before and after: 1071 tests, 20 errors, 1 failure. These are the known host-only gaps.The PHPUnit legs in CI are the real proof. Any test that now runs and fails is inherited debt and is listed in the follow-up.
🤖 Generated with Claude Code