PoC: Showcase ibexa/test-core Bootstrapper in BasicKernelTest - #810
Draft
Steveb-p wants to merge 6 commits into
Draft
PoC: Showcase ibexa/test-core Bootstrapper in BasicKernelTest#810Steveb-p wants to merge 6 commits into
Steveb-p wants to merge 6 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.
|
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.