Skip to content

Conversation

@mhsdesign
Copy link
Member

@mhsdesign mhsdesign commented Nov 2, 2025

These repositories are listed (correctly) in

flow configuration:show --path Neos.Flow.persistence.doctrine.migrations.ignoredTables

which causes doctrine to ignore them when creating new migrations for new entities.

Also the FlowEntities trait for doctrine in behat use does not truncate these tables as they are foreign matter.

Now previously we uses the php apis of the respective repositories to empty the tables but the apis require the CR-Id to be handed in.

We can get a hold of the tested CR by using $alreadySetUpContentRepositories - checking the CR-Registry for available CRs would be wrong as one can dynamically define a CR in testing. This dynamic definition of a CR will only happen after the first Scenario is run. Before $alreadySetUpContentRepositories would be empty. This means that when running a first behat test which uses the WorkspaceService the test will likely fail as the database still contains values.

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

These repositories are listed (correctly) in

```
flow configuration:show --path Neos.Flow.persistence.doctrine.migrations.ignoredTables
```

which causes doctrine to ignore them when creating new migrations for new entities.

Also the FlowEntities trait for doctrine in behat use does not truncate these tables as they are foreign matter.

Now previously we uses the php apis of the respective repositories to empty the tables but the apis require the CR-Id to be handed in.

We can get a hold of the tested CR by using `$alreadySetUpContentRepositories` - checking the CR-Registry for available CRs would be wrong as one can dynamically define a CR in testing.
This dynamic definition of a CR will only happen after the first Scenario is run. Before `$alreadySetUpContentRepositories` would be empty.
This means that when running a first behat test which uses the WorkspaceService the test will likely fail as the database still contains values.

This change uses a pure TRUNCATE now. The methods are not added to the respective repository as these TRUNCATE are not abstracted by dbal and might now support all DB targets.
@mhsdesign mhsdesign marked this pull request as draft November 4, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant