[BUGFIX] Move test fixtures to separate test extension#9
Conversation
Remove test fixture services from global Configuration/Services.yaml Remove test fixture persistence mappings from global Extbase config Structure test fixtures as mini-extension in Tests/Functional/Fixtures/ Update tests to load fixtures extension via testExtensionsToLoad This fixes crashes when the extension is used as a dependency, where autoload-dev classes are not available but were being referenced in global configuration files.
There was a problem hiding this comment.
Pull request overview
This PR isolates functional-test fixture configuration into a dedicated mini-extension so the main extension no longer references autoload-dev classes from global TYPO3 configuration (preventing crashes when pagebased is installed as a dependency without dev autoloading).
Changes:
- Removed fixture service definitions from
Configuration/Services.yaml. - Removed fixture Extbase persistence class mappings from
Configuration/Extbase/Persistence/Classes.php. - Added a fixtures mini-extension under
Tests/Functional/Fixtures/and updated functional tests to load it viatestExtensionsToLoad.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Functional/Performance/RepositoryPerformanceTest.php | Loads the fixtures mini-extension in functional performance tests. |
| Tests/Functional/Domain/Repository/AbstractObjectRepositoryTest.php | Loads the fixtures mini-extension in repository functional tests. |
| Tests/Functional/Fixtures/ext_emconf.php | Defines the fixtures mini-extension metadata/constraints. |
| Tests/Functional/Fixtures/Configuration/Services.yaml | Registers fixture classes as container services for tests. |
| Tests/Functional/Fixtures/Configuration/Extbase/Persistence/Classes.php | Adds Extbase persistence mappings for fixture domain classes. |
| Configuration/Services.yaml | Removes fixture class service registration from production configuration. |
| Configuration/Extbase/Persistence/Classes.php | Removes fixture persistence mappings from production configuration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR moves functional test fixtures (services + Extbase persistence mappings) out of global extension configuration into a dedicated fixtures mini-extension to prevent runtime crashes when the extension is installed as a dependency without autoload-dev.
Changes:
- Removes test-fixture DI services from
Configuration/Services.yaml. - Removes test-fixture Extbase persistence class mappings from the global Extbase config.
- Introduces a fixtures mini-extension under
Tests/Functional/Fixtures/and updates functional tests to load it via$testExtensionsToLoad.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| Tests/Functional/Performance/RepositoryPerformanceTest.php | Loads fixtures extension for performance functional tests and updates dataset import path. |
| Tests/Functional/Domain/Repository/AbstractObjectRepositoryTest.php | Loads fixtures extension for repository functional tests and updates dataset import path / docs. |
| Tests/Functional/Fixtures/ext_emconf.php | Adds TYPO3 extension metadata for the fixtures mini-extension. |
| Tests/Functional/Fixtures/Configuration/Services.yaml | Registers fixture classes as services in the fixtures extension container. |
| Tests/Functional/Fixtures/Configuration/Extbase/Persistence/Classes.php | Provides Extbase persistence mappings for fixture domain models. |
| Configuration/Services.yaml | Removes test-fixture services from production DI configuration. |
| Configuration/Extbase/Persistence/Classes.php | Removes test-fixture persistence mappings from production config. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| { | ||
| parent::setUp(); | ||
| $this->importCSVDataSet(__DIR__ . '/../Fixtures/Database/pages_many_objects.csv'); | ||
| $this->importCSVDataSet(__DIR__ . '/../pagebased_test_fixtures/Database/pages_many_objects.csv'); |
| * - Identifier constraint (_pagebased_registration = 'test_news') | ||
| * | ||
| * Fixtures: Tests/Functional/Fixtures/Database/pages_objects.csv | ||
| * Fixtures: Tests/Functional/fixtures/Database/pages_objects.csv |
This reverts commit dbd0038.
This fixes crashes when the extension is used as a dependency, where autoload-dev classes are not available but were being referenced in global configuration files.