Skip to content

[BUGFIX] Move test fixtures to separate test extension#9

Merged
teneris merged 3 commits into
masterfrom
bugfix/test-fixtures-as-extension
Mar 16, 2026
Merged

[BUGFIX] Move test fixtures to separate test extension#9
teneris merged 3 commits into
masterfrom
bugfix/test-fixtures-as-extension

Conversation

@srosskopf
Copy link
Copy Markdown
Member

  • 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.

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.
Copilot AI review requested due to automatic review settings March 14, 2026 09:38
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 via testExtensionsToLoad.

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.

Comment thread Tests/Functional/Performance/RepositoryPerformanceTest.php
Comment thread Tests/Functional/Domain/Repository/AbstractObjectRepositoryTest.php
Comment thread Tests/Functional/Fixtures/ext_emconf.php
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 14, 2026 09:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Tests/Functional/Domain/Repository/AbstractObjectRepositoryTest.php Outdated
Comment thread Tests/Functional/Performance/RepositoryPerformanceTest.php
{
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
Comment thread Tests/Functional/Domain/Repository/AbstractObjectRepositoryTest.php
@srosskopf srosskopf requested a review from teneris March 16, 2026 07:58
Copy link
Copy Markdown
Contributor

@teneris teneris left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passt

@teneris teneris merged commit b43c101 into master Mar 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants