Skip base test_data.yaml fixture when Doctrine Migrations already imported it - #42
Skip base test_data.yaml fixture when Doctrine Migrations already imported it#42Steveb-p wants to merge 1 commit into
Conversation
…orted it Ibexa\Bundle\RepositoryInstaller\Migration\ImportDataMigration (run via ibexa:doctrine:migrations:migrate when the SchemaBuilderEvent path is disabled) inserts the same baseline content that IbexaTestKernel's default getFixtures() also unconditionally imports via test_data.yaml, causing a UniqueConstraintViolationException on the second import. Package-specific fixtures added by subclasses (`yield from parent::getFixtures(); yield new Fixture(...)`) are unaffected and still run in both modes, since they're additive rather than overlapping with ImportDataMigration's output.
40c4aac to
9165614
Compare
|
Closing — the premise no longer holds after #43. The guard was written when Two concrete problems with it as it stands:
Skipping fixture import is already supported via Exercising the Doctrine Migrations install path in tests will be revisited separately, via two distinct bootstrap setups rather than a flag threaded through the shared kernel. |
Description:
IbexaTestKernel::getFixtures()unconditionally importstest_data.yamlas baseline test content. When a test kernel runs the Doctrine Migrations schema-install path instead of the legacy SchemaBuilderEvent one (ibexa:doctrine:migrations:migrateinstead of dispatching the event),Ibexa\Bundle\RepositoryInstaller\Migration\ImportDataMigrationalready inserts that same baseline content as part of schema install. Importingtest_data.yamlon top of that throwsUniqueConstraintViolationException.Skips the base fixture when
IBEXA_TEST_SCHEMA_BUILDER_EVENT_ENABLED=0. Package-specific fixtures added by subclasses (yield from parent::getFixtures(); yield new Fixture(...)) are unaffected either way — they're additive, not overlapping withImportDataMigration's output.