[BUGFIX] Drop only bootstrap-opened output buffers#733
Merged
Conversation
TYPO3 v15 removes the implicit output buffer that Bootstrap::init() opened as its very first action. Two places compensated for that buffer with an unconditional ob_end_clean(): setUpBasicTypo3Bootstrap() in Testbase and executeFrontendSubRequest() in FunctionalTestCase. Without the bootstrap buffer, these calls close phpunit's own output buffer instead. phpunit then reports every functional test as risky with "Test code or tested code closed output buffers other than its own", which fails all functional jobs of the core test suite. Both places now remember ob_get_level() before Bootstrap::init() and unwind only the buffers opened above that level. This keeps working with TYPO3 v14, where the bootstrap still opens a buffer, and it additionally guards the frontend sub request against stray buffers left open by extension code. Resolves: #732 Related: https://forge.typo3.org/issues/110250 Related: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94863 Releases: main
bmack
approved these changes
Jul 23, 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 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.
TYPO3 v15 removes the implicit output buffer that
Bootstrap::init()opened asits very first action. Two places in this package compensated for that buffer
with an unconditional
ob_end_clean():Testbase::setUpBasicTypo3Bootstrap()— called from both branches ofFunctionalTestCase::setUp(), i.e. once per testFunctionalTestCase::executeFrontendSubRequest()— the "somewhere anob_start()is called in frontend" of that comment is theBootstrap::init()call a few lines aboveWithout the bootstrap buffer these calls close phpunit's own output buffer
instead, and phpunit reports every functional test as risky with
Test code or tested code closed output buffers other than its own.Both places now remember
ob_get_level()beforeBootstrap::init()and unwindonly the buffers opened above that level. Deleting the calls outright was not an
option: branch
mainsupportstypo3/cms-core: 14.*.*@dev || 15.*.*@dev, andTYPO3 v14
Bootstrap::init()still opens the buffer — a plain removal wouldflip the failure mode on v14 to
…did not close its own output buffers. Thewhileloop additionally guards the frontend sub request against stray buffersleft open by extension code, which is what the old "work around that for now"
comment was really about.
Reproduction
TYPO3 Core
mainwith https://review.typo3.org/c/Packages/TYPO3.CMS/+/94863cherry-picked, before this change:
Core CI for that change fails in all functional jobs (sqlite 3/3, mariadb 6/6,
postgres 10/10) while
unit,phpstan,cgl,lint,integration various,documentation renderingand the playwright e2e jobs stay green.Core test runs with this change
vendor/typo3/testing-frameworkreplaced by this branch.TYPO3 v15 — Core
main@3c6390b797a+ Gerrit 94863/1 cherry-picked,PHP 8.5, sqlite:
TYPO3 v14 — Core
14@dd5735757cb(bootstrap does open the buffer),PHP 8.2, sqlite:
Package quality gates
Build/Scripts/runTests.shin this repo, PHP 8.2 (default):-s composerUpdate-s cgl -n-s lint-s phpstan-s unitNotes
No backport needed: branches
9/8/7do not support TYPO3 v15, so theirbootstrap always opens the buffer and the current unconditional
ob_end_clean()stays correct there.
Resolves: #732
Related: https://forge.typo3.org/issues/110250
Related: https://review.typo3.org/c/Packages/TYPO3.CMS/+/94863
Releases: main