RFC: Showcase ibexa/test-core Bootstrapper in BasicKernelTest - #810
Open
Steveb-p wants to merge 11 commits into
Open
RFC: Showcase ibexa/test-core Bootstrapper in BasicKernelTest#810Steveb-p wants to merge 11 commits into
Steveb-p wants to merge 11 commits into
Conversation
BasicKernelTest no longer calls self::loadSchema()/self::loadFixtures() per test; tests/integration/bootstrap.php now does it once via the new Bootstrapper class from ibexa/test-core. Moved to its own phpunit-integration.xml since it needs a different KERNEL_CLASS/bootstrap than the rest of the legacy integration suite.
Points CI at the kernel-test-bootstrap-v2 branch that adds the Bootstrapper class this PR depends on, so tests can run before that PR merges. Must be removed before merging.
Both were read-only (no content/user/role mutations), the safe subset of RepositoryTestCase's 16 leaf classes to move off the per-test self::loadSchema()/loadFixtures() pattern without needing per-test transactional isolation first - the other 14 mutate repository data and have nothing (no DAMADoctrineTestBundle or similar) to roll that back between tests today. Added tests/integration/Core/TestKernel.php, overriding getFixtures() to keep loading the same Legacy/data/test_data.yaml fixture set these tests were already calibrated against (25 content types, specific admin user field values, etc.) instead of the shared kernel's own smaller generic default - otherwise their assertions would fail on a mismatched fixture set despite the migration itself being safe.
… tests Mutating tests couldn't use the Bootstrapper before, since it only imports schema/fixtures once per suite run rather than per test. DAMA wraps each test in a transaction rolled back afterwards, so RepositoryTestCase no longer needs to reimport schema/fixtures in setUp(). TestKernel also needed to set the ibexa.kernel.root_dir container parameter itself: the shared ibexa/test-core kernel has no knowledge of it, so without an override it fell back to the production default (vendor/ibexa/core), breaking TransformationProcessor's .tr/.tr.result fixture paths when running ibexa-core's own suite standalone.
Converts self::getXxxService()/self::setAdministratorUser() calls to $this->getIbexaTestCore()->getXxxService() now that RepositoryTestCase no longer boots through the legacy per-test schema/fixture loading. TrashService and URLAliasService have no dedicated getter on IbexaTestCoreInterface, so DeleteContentTest and UrlAliasLookupTest fall back to getServiceByClassName() for those two.
Steveb-p
force-pushed
the
kernel-test-bootstrap-v2
branch
from
August 24, 2026 10:11
34bca01 to
7a5098f
Compare
alongosz
reviewed
Aug 24, 2026
Member
There was a problem hiding this comment.
Good idea on splitting. Wondering if we should stick to legacy naming pattern or we should use the new one: phpunit.integration.xml? Not sure myself, given the old files still exist and might create confusion 🤔
…ce calls RepositoryTestCase's parent class was swapped from the old IbexaKernelTestCase (which provided static getXxxService() methods) to the new one earlier in this branch, breaking this file's inherited static calls at the PHPStan level even though its own migration was deliberately deferred. LegacyTestKernel already implements the same IbexaTestKernelInterface getIbexaTestCore() requires, so no other change is needed here.
Its parent RepositoryTestCase no longer imports schema/fixtures per test (that moved to the Bootstrapper mechanism earlier in this branch), so this test — which was left out of that migration because it boots its own dedicated LegacyTestKernel — was failing at runtime under both phpunit-integration-legacy.xml (never excluded there) and phpunit-integration-legacy-solr.xml (only its own excluded Repository/Filtering directory covered it, not the 15 already-migrated sibling files under other directories that were also still reachable there). Excluded it from phpunit-integration-legacy.xml, added the same 15 missing exclude entries to phpunit-integration-legacy-solr.xml, moved the file into phpunit-integration.xml's file list, and registered DAMADoctrineTestBundle on LegacyTestKernel so it gets the same per-test transaction isolation as its new siblings there.
…Case Both extended IbexaKernelTestCase directly with a setUp() that was just a copy of RepositoryTestCase::setUp() — no deliberate reason for the inconsistency with the other 13 migrated tests, so extending RepositoryTestCase removes the duplication.
ibexa/test-core renamed __invoke() to bootstrap() and now shuts the kernel down itself by default, so the explicit ->shutdown() call here is no longer needed.
ibexa/test-core reverted its shared kernel to not auto-register this bundle anymore (it broke downstream kernels that already register it themselves), so a kernel that goes through Bootstrapper - this one does, via tests/integration/bootstrap.php - needs to register it itself again.
|
Steveb-p
marked this pull request as ready for review
August 25, 2026 08:32
ibexa-workflow-automation-1
Bot
requested review from
ViniTou,
alongosz,
barw4,
bnowak,
ciastektk,
konradoboza,
mikadamczyk,
tbialcz and
wiewiurdp
and removed request for
a team
August 25, 2026 08:32
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.



Warning
This branch includes a temporary commit (
dependencies.json) that points CI at ibexa/test-core#38 so tests can run before that PR merges. Must be removed before merging this PR.Related PRs:
Description:
Switches
BasicKernelTestover to the newibexa/test-coreBootstrapper instead of the per-testself::loadSchema()/self::loadFixtures()calls it used before. Schema and fixtures now get imported once, intests/integration/bootstrap.php, via(new Bootstrapper())()->shutdown()— the test itself just boots the kernel and asserts.Pulled
BasicKernelTest.phpout ofphpunit-integration-legacy.xml'sintegration_coresuite (via<exclude>) into a newphpunit-integration.xml, since it now needs a different bootstrap/KERNEL_CLASS than the rest of that legacy suite. Everything else intests/integration/Coreis untouched.