Skip to content

test: boot integration tests through core's test bootstrap - #572

Merged
oc-tmueller merged 1 commit into
masterfrom
test/integration-core-bootstrap
Oct 15, 2026
Merged

oc-tmueller merged 1 commit into
masterfrom
test/integration-core-bootstrap

Conversation

@oc-tmueller

Copy link
Copy Markdown
Contributor

phpunit.integration.xml boots with bootstrap="../../lib/base.php", so PHPUNIT_RUN is never defined. Core therefore installs its production OC\Log\ErrorHandler, and PHPUnit 9's own handler backs off. Every PHP notice and warning raised in the integration suite goes to owncloud.log, and the suite stays green. CI runs this suite (do-integration-tests: true → make test-php-integration). See owncloud/core#41904.

This PR switches the bootstrap to core's tests/bootstrap.php, as phpunit.xml already does. That file defines PHPUNIT_RUN and loads the enabled apps.

Verified on oC 11 (owncloudci/php:8.3) with an E_USER_WARNING planted in NotesControllerTest::testUpdate:

result "app":"PHP" entries in owncloud.log
before OK (2 tests) 3: the plant, plus two real foreach() … null given warnings from apps/dav/lib/HookManager.php#121/#126
after Errors: 1 (PLANTED-41904) 0

Without the plant, the suite is green after the change on two consecutive runs. The HookManager warnings didn't recur under core's bootstrap.

PHPUnit 9 still fails on deprecations only with convertDeprecationsToExceptions="true", which this config doesn't set. This PR leaves the rest of the config alone (pre-9.3 schema, no failOnWarning).

🤖 Generated with Claude Code

phpunit.integration.xml loaded lib/base.php directly, without
PHPUNIT_RUN, so core installed its production OC\Log\ErrorHandler.
PHPUnit's own handler then backed off, and every PHP notice and warning
in the integration suite went to owncloud.log while the tests stayed
green. CI runs this suite (do-integration-tests: true), and a planted
E_USER_WARNING passed it.

Use core's tests/bootstrap.php, as phpunit.xml already does. It defines
PHPUNIT_RUN and loads the enabled apps. The planted warning now fails
the test, and the current suite stays green. PHPUnit 9 still fails on
deprecations only with convertDeprecationsToExceptions="true", which
this config does not set.

Refs owncloud/core#41904

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Thomas Müller <323649642+oc-tmueller@users.noreply.github.com>
@oc-tmueller
oc-tmueller requested a review from a team as a code owner October 15, 2026 13:47
@CLAassistant

CLAassistant commented Oct 15, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@oc-tmueller

Copy link
Copy Markdown
Contributor Author

@phil-davis @jvillafanez

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.

3 participants